Advertisement
Guest User

Untitled

a guest
Feb 26th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. //Send a message with one line of code
  2. RC.Gmail.GmailMessage.SendFromGmail("username", "password", "toAddress@gmail.com", "subject", "message body");
  3.  
  4. //Send a message with one line of code with a MailMessage object
  5. RC.Gmail.GmailMessage.SendMailMessageFromGmail("username", "password", mailMessageObject);
  6.  
  7. //Use the GmailMessage object to create and send your message
  8. RC.Gmail.GmailMessage gmailMsg = new RC.Gmail.GmailMessage("username", "password");
  9. gmailMsg.To = "RCcode@gmail.com";
  10. gmailMsg.From = "fromAddress@gmail.com";
  11. gmailMsg.Subject = "C# Test Message";
  12. gmailMsg.Body = "Test body";
  13.  
  14. MailAttachment attachment = new MailAttachment(@"c:\testfile.txt");
  15. gmailMsg.Attachments.Add(attachment);
  16.  
  17. gmailMsg.Send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement