Hello,
I'm using Microsoft Graph API for sending E-Mails to someone why I used this method is Basic Authentication will be removed on 1 October.
But I encountered some problems which is sending email is so slow or does not exactly reach Inbox accurately.
Sometimes, I POST a Request then E-Mail is firing instantly then I thank Microsoft servers :)
But generally (not sometimes) when I POST a request to send a E-Mail, anything does not reach Inbox's even 5 min later.
So I cannot trust this API for uncertainty. Any help appreciated thanks a lot.
NOTE: I'm using this with license which is Azure Developer Program
I am using this cURL request for getting AccessToken:
curl --location --request POST 'https://login.microsoftonline.com/**TENANT_ID**/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=**CLIENT_ID**' \
--data-urlencode 'client_secret=**CLIENT_SECRET**' \
--data-urlencode 'scope=https://graph.microsoft.com/.default'
I am using this cURL request for sending a mail:
curl --location --request POST 'https://graph.microsoft.com/v1.0/users/**USER_ID**/sendMail' \
--header 'Authorization: Bearer **ACCESS_TOKEN**' \
--header 'Content-Type: application/json' \
--data-raw '{
"message": {
"subject": "Meet for lunch?",
"body": {
"contentType": "Text",
"content": "The new cafeteria is open."
},
"toRecipients": [
{
"emailAddress": {
"address": "test@gmail.com",
"name": "FOOO"
}
}
]
}
}'