Skip to contentSkip to navigationSkip to topbar

SendGrid

Find the documentation, sample code, and developer tools you need to build your transactional and marketing email solutions on the platform that offers a 99% deliverability rate.

Let's build

Take the next steps with SendGrid

Send your first email
1
Twilio servers
2
Your app

const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
const msg = {
subject: 'Ahoy!',
html: 'Ahoy, World!',
};
sgMail
.send(msg)
.then((error) => console.error(error));

View complete examples(link takes you to an external page)
3
Ahoy, World!

Take the next steps with SendGrid


Send your first email

Get started quickly with the Twilio SendGrid Mail Send API and our open-source helper libraries. The sample code below will send your first message in no time.

C#GoJavaNode.jsPHPPythonRuby

_20
using System;
_20
using System.Threading.Tasks;
_20
using SendGrid;
_20
using SendGrid.Helpers.Mail;
_20
_20
class Program
_20
{
_20
static async Task Main()
_20
{
_20
var apiKey = Environment.GetEnvironmentVariable("SENDGRID_API_KEY");
_20
var client = new SendGridClient(apiKey);
_20
var from = new EmailAddress("[email protected]", "Example User");
_20
var subject = "Sending with Twilio SendGrid is Fun";
_20
var to = new EmailAddress("[email protected]", "Example User");
_20
var plainTextContent = "and easy to do anywhere, even with C#";
_20
var htmlContent = "<strong>and easy to do anywhere, even with C#</strong>";
_20
var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);
_20
var response = await client.SendEmailAsync(msg).ConfigureAwait(false);
_20
}
_20
}

Email API quickstarts

Jump to an email quickstart in your programming language of choice for a full guide on how to implement the code samples above.


Do more with email

Sending email is just the start. With SendGrid, you get rich data that allows you to establish and maintain a complete email program. You can also parse inbound messages to create rich email-based experiences for your customers.

Looking to leverage SendGrid's reliability and scale for your SMTP needs or integrate with a cloud partner such as Azure? You can do that too.

Beyond sending your first email

Get started with Marketing Campaigns

Create beautifully designed messages, personalized to each recipient, with best in class deliverability when you send with Marketing Campaigns.


Explore Twilio's other communication channels to build customer engagement infrastructure that fits the unique requirements of your business.

Messaging
Messaging

Send and receive SMS/MMS and/or WhatsApp messages with the Twilio's Programmable Messaging API.

Product documentation
Voice
Voice

Quickly make and receive voice calls in your application with Twilio Voice.

Product documentation
Flex
Flex

Build your digital engagement center for sales and customer support teams with Twilio Flex.

Product documentation

Rate this page: