I want to send a message using the Google Gmail API. I have successfully authenticated and am trying to use GmailService to send a message.
I would like to use this:
myService.Users.Messages.Send(myMessage, "me").Execute();
where myService is Google.Apis.Gmail.v1.GmailService and myMessage is Google.Apis.Gmail.v1.Data.Message .
myService great, I did an OAuth dance. I can receive messages from the inbox and all that. But I do not know how to build myMessage . I have standard .NET MailMessage , with the person being read by Subject, Body, To, From, etc.
But the Google Message class accepts Payload or Raw fields. What is the easiest way to convert full MailMessage to a string that I can set for Payload or Raw properties? Or is this not what I should do at all?
Documentation for the message class .
source share