Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

Latest commit

 

History

History
43 lines (40 loc) · 1.01 KB

README.md

File metadata and controls

43 lines (40 loc) · 1.01 KB

sendgrid-dotnet

This repo isn't maintained anymore, please use the official SendGrid SDK here!

Little library for using SendGrid's v3 mail API with DotNet Core.

Simple Usage Example

var key = new ApiKeyConnection("SG.api.key");
var client = new SendGridClient(key);
client.MailClient.SendAsync(new Email
{
    Personalizations = new List<Personalization>
    {
        new Personalization
        {
            To = new List<EmailDetail>
            {
                new EmailDetail
                {
                    Email = "customer@yahoooooo.com",
                    Name = "Customer Name"
                }
            }
        }
    },
    From = new EmailDetail
    {
        Email = "no-reply@company.domain",
        Name = "Company Letter"
    },
    Subject = "sup",
    Content = new List<Content>
    {
        new Content
        {
            Type = "text/html",
            Value = "<h1>yo yo! :)</h1>"
        }
    }
}).Wait();