Jump to an email quickstart in your programming language of choice for a full guide on how to implement the code samples above.
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.
Take the next steps with 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 SendGrid
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.
_20using System;_20using System.Threading.Tasks;_20using SendGrid;_20using SendGrid.Helpers.Mail;_20_20class 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("test@example.com", "Example User");_20 var subject = "Sending with Twilio SendGrid is Fun";_20 var to = new EmailAddress("test@example.com", "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}
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.
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.
Send and receive SMS/MMS and/or WhatsApp messages with the Twilio's Programmable Messaging API.
Product documentationQuickly make and receive voice calls in your application with Twilio Voice.
Product documentationBuild your digital engagement center for sales and customer support teams with Twilio Flex.
Product documentation