An API that connects multiple Microsoft services, enabling data access and automation across platforms
Any update?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Im using MS Graph API to send emails using a service account. I have followed the official documentation provided by Microsoft for the same operation https://learn.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0&tabs=csharp
Im not able to figure out why SendMail(message).Request().PostAsync() doesnot send email but SendMail(message).Request().PostResponseAsync().GetAwaiter().GetResult() does.
Need help with the reason behind it. Thanks in advance
An API that connects multiple Microsoft services, enabling data access and automation across platforms
After testing, I reproduced your problem locally and it is indeed not possible to use C# to call users/{user id} to send mail (testing with postman seems to work). I will submit this bug with the graph product team later, please wait for my update.
I tested this code snippet and it doesn't seem to be a problem, I can send emails correctly. After the code is working correctly, you still haven't received any mail in outlook?
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.