Last active
May 17, 2017 23:48
-
-
Save jguadagno/c81dc63e703278db5a78ad81fd5e659e to your computer and use it in GitHub Desktop.
SendGrid - ReplyTo for Hotmail.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string apiKey = ConfigurationManager.AppSettings["SendGrid.ApiKey"]; | |
var sendGrid = new SendGridClient(apiKey); | |
var msg = new SendGridMessage(); | |
msg.SetFrom(new EmailAddress("noreply@yourdomain.com", "No Reply")); | |
msg.AddTo(new EmailAddress("reciever@theirdomain.com", "Joe Dirt")); | |
msg.SetSubject("Hello World"); | |
msg.AddContent(MimeType.Text, "Hello World"); | |
msg.AddContent(MimeType.Html, <html><body>My Body</body></html>); | |
if (!string.IsNullOrEmpty(emailMessage.ReplyToMailAddress)) | |
{ | |
msg.SetReplyTo(new EmailAddress("jguadagno@hotmail.com", "Joseph Guadagno")); | |
} | |
var response = sendGrid.SendEmailAsync(msg).Result; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment