首页 > 代码库 > 使用azure send grid发送email
使用azure send grid发送email
1. create a send grid account
2. remember the username/password of the send grid account
3. install sendgrid nuget pkg
4. get key
manage ->it will redirect you to manage portal
create a new api key:
4. sample code of console application
2. remember the username/password of the send grid account
3. install sendgrid nuget pkg
4. get key
manage ->it will redirect you to manage portal
create a new api key:
4. sample code of console application
using System; using System.Net.Mail; using SendGrid; namespace SendGridAzureSample { class Program { static void Main(string[] args) { SendGridMessage myMessage = new SendGridMessage(); myMessage.AddTo("send_to"); myMessage.From = new MailAddress("from_email", "Display name"); myMessage.Subject = "Testing the SendGrid Library"; myMessage.Text = "Hello World!"; //myMessage.AddAttachment(@"attachment_path"); var key = "your_key"; // create a Web transport, using API Key var transportWeb = new Web(key); transportWeb.DeliverAsync(myMessage); Console.ReadKey(); } } }
reference link : https://azure.microsoft.com/en-us/documentation/articles/sendgrid-dotnet-how-to-send-email/
使用azure send grid发送email
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。