zoukankan      html  css  js  c++  java
  • 使用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


    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/

  • 相关阅读:
    两数之和
    swift 结构体
    打家劫舍II
    Swift的访问控制讲解
    swift版 二分查找 (折半查找)
    RAC(ReactiveCocoa)介绍(一)
    变位词
    双向循环链表
    单链表
    顺序链表(C++)
  • 原文地址:https://www.cnblogs.com/gccbuaa/p/7215928.html
Copyright © 2011-2022 走看看