Hi @FFor
You can try using auth code flow to get an access token and a refresh token.
1.Run the URL in the browser to get the authorization code.
https://login.microsoftonline.com/{tenant id}/oauth2/v2.0/authorize?
client_id={client id}
&response_type=code
&redirect_uri={redirect url}
&response_mode=query
&scope=https://graph.microsoft.com/SMTP.Send offline_access
&state=12345
2.Use the authorization code to redeem an access token and a refresh token.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.