Skip to content

Instantly share code, notes, and snippets.

@jguadagno
Last active May 17, 2017 23:48
Show Gist options
  • Save jguadagno/c81dc63e703278db5a78ad81fd5e659e to your computer and use it in GitHub Desktop.
Save jguadagno/c81dc63e703278db5a78ad81fd5e659e to your computer and use it in GitHub Desktop.
SendGrid - ReplyTo for Hotmail.com
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