Wednesday, October 8, 2014

Send email using Mail API in C#

Because I couldn't find anything online, here's my contribution to the community. This code snippet shows you how to send a message using the C# SDK for the Exchange Mail REST API.

IMessage message = new Message();
Recipient recipient = new Recipient();
recipient.Name = "abcde";
recipient.Address = "";
ItemBody body = new ItemBody();
body.Content = "Hey!";
message.Body = body;
await mailClient.Me.Messages.AddMessageAsync(message);