Twilio SendGrid
Build transactional and marketing email solutions with Twilio SendGrid.
Take the next steps with Twilio SendGrid
const sgMail = require('@sendgrid/mail');sgMail.setApiKey(process.env.SENDGRID_API_KEY);const msg = {to: 'recipient@example.com',from: 'sender@example.com',subject: 'Ahoy!',html: 'Ahoy, World!',};sgMail.send(msg).then((error) => console.error(error));
Take the next steps with Twilio SendGrid
Send your first email
Get started with the Twilio SendGrid Mail Send API and the open-source SDKs. To send your first message, use the following sample code in your preferred programming language.
1using System;2using System.Threading.Tasks;3using SendGrid;4using SendGrid.Helpers.Mail;56class Program7{8static async Task Main()9{10var apiKey = Environment.GetEnvironmentVariable("SENDGRID_API_KEY");11var client = new SendGridClient(apiKey);12var from = new EmailAddress("test@example.com", "Example User");13var subject = "Sending with Twilio SendGrid is Fun";14var to = new EmailAddress("test@example.com", "Example User");15var plainTextContent = "and easy to do anywhere, even with C#";16var htmlContent = "<strong>and easy to do anywhere, even with C#</strong>";17var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);18var response = await client.SendEmailAsync(msg).ConfigureAwait(false);19}20}
Do more with email
Twilio SendGrid offers tools that build your email communications program. Gather data from and report on the effectiveness of your email campaigns. Add content and accept files through inbound email. Use Twilio SendGrid to send and receive email or integrate with a cloud partner for email processing.
- Get started with the Email API
- [Set up domain authentication][domain-authentication]
- Review the SendGrid v3 API reference
- Review the Email glossary
Get started with Marketing Campaigns
Create well-designed, personalized messages for your Marketing Campaigns.
- Build templates with email designs
- [Design messages with the Design and Code Editor][design-and-code-editor]
- Add dynamic content with Handlebars in Marketing Campaigns
Related products
Build your customer engagement infrastructure that fits the unique requirements of your business with the other communication channels from Twilio.
Send and receive Short Message Service (SMS), Multimedia Messaging Service (MMS), Rich Communication Services (RCS), or WhatsApp messages with Twilio Programmable Messaging.
Product documentationSend and receive voice calls through your app with Twilio Programmable Voice.
Product documentationBuild your digital engagement center for sales and customer support teams with Twilio Flex.
Product documentation