Last active
May 11, 2016 17:47
-
-
Save sendgrid-gists/6cb4e8c51d967013d399a50f7db9381e to your computer and use it in GitHub Desktop.
"Hello World" for email, using SendGrid with C#.
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
// using SendGrid's C# Library | |
// https://github.com/sendgrid/sendgrid-csharp | |
using System.Net.Http; | |
using System.Net.Mail; | |
var myMessage = new SendGrid.SendGridMessage(); | |
myMessage.AddTo("test@sendgrid.com"); | |
myMessage.From = new MailAddress("you@youremail.com", "First Last"); | |
myMessage.Subject = "Sending with SendGrid is Fun"; | |
myMessage.Text = "and easy to do anywhere, even with C#"; | |
var transportWeb = new SendGrid.Web("SENDGRID_APIKEY"); | |
transportWeb.Deliver(myMessage).Wait(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment