i am using below code to send email using microsoft graph
await graphClient.Me.SendMail(message, true).Request().PostAsync()
Since post operation doesnt return anything then how to detect status code 429 (Throttle response code)and handle it.
PostAsync() method should throw a ServiceException on error. For example:
try
{
await graphClient.Users[userId].SendMail(message).Request().PostAsync();
}
catch (Microsoft.Graph.ServiceException e)
{
Console.WriteLine(e.Error);
}
Thanks Dev.. got response from Microsoft developer community too. according to them , no need to check 429 status . graphserviceclient automatically retries . in case of too many retries, client throws toomanyretries service exception
Good to hear!! Thanks for updating the same @riks. Its useful to other members in the community as well.