Twilio SendGrid

Email API

Reach customers using the email API leading businesses trust for reliable delivery at scale.

See plans and pricing

Twilio SendGrid

Deliver every critical message, every time with our Email API.

Deliver your critical Announcements through our fully redundant architecture that sends over 70 billion emails per month.

Adapt your Notifications to maximize impact for critical communications with flexible RESTful APIs and libraries to support your programming language.

Collaborate across teams to design on-brand Confirmation emails with dynamic template building and content testing.

Send with confidence
Twilio SendGrid's Email API gives developers the flexibility to turn their ideas into reality, and the support to scale them into production.
Integrate and deliver email in 5 minutes or less
Twilio SendGrid supports the programming languages you love. Use rock-solid documentation to build password resets, trigger marketing messages, and craft the experiences your customers appreciate.
Scale on a reliable platform
Don’t let a sub-par email platform bring you down. Twilio SendGrid’s Email API ensures you can scale to enterprise-volume easily. We process over 70 billion emails a month while maintaining a 99.999% uptime.
We’ve got your back
When you build on Twilio SendGrid, you’re building on a platform with a lifetime of best practices baked in. Manage and edit email templates in the UI and automatically display the latest content in your email with a simple API call. Troubleshoot easily with powerful developer tools. Securely share critical data across teams, all from one platform.
  • Node.js
  • C#
  • PHP
  • Ruby
  • Python
  • Java
// using Twilio SendGrid's v3 Node.js Library
const sgMail = require('@sendgrid/mail');
const msg = {
  to: '',
  from: '',
  subject: 'Sending with Twilio SendGrid is Fun',
  text: 'and easy to do anywhere, even with Node.js',
  html: 'and easy to do anywhere, even with Node.js',
// using SendGrid's C# Library
using SendGrid;
using SendGrid.Helpers.Mail;
using System;
using System.Threading.Tasks;

namespace Example
    internal class Example
        private static void Main()

        static async Task Execute()
            var apiKey = Environment.GetEnvironmentVariable("NAME_OF_THE_ENVIRONMENT_VARIABLE_FOR_YOUR_SENDGRID_KEY");
            var client = new SendGridClient(apiKey);
            var from = new EmailAddress("", "Example User");
            var subject = "Sending with SendGrid is Fun";
            var to = new EmailAddress("", "Example User");
            var plainTextContent = "and easy to do anywhere, even with C#";
            var htmlContent = "and easy to do anywhere, even with C#";
            var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);
            var response = await client.SendEmailAsync(msg);
require 'vendor/autoload.php'; // If you're using Composer (recommended)
// Comment out the above line if not using Composer
// require("/sendgrid-php.php");
// If not using Composer, uncomment the above line and
// download from the latest release here,
// replacing  with the path to the sendgrid-php.php file,
// which is included in the download:
$email = new \SendGrid\Mail\Mail();
$email->setFrom("", "Example User");
$email->setSubject("Sending with SendGrid is Fun");
$email->addTo("", "Example User");
$email->addContent("text/plain", "and easy to do anywhere, even with PHP");
    "text/html", "and easy to do anywhere, even with PHP"
$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
try {
    $response = $sendgrid->send($email);
    print $response->statusCode() . "\n";
    print $response->body() . "\n";
} catch (Exception $e) {
    echo 'Caught exception: '. $e->getMessage() ."\n";
# using SendGrid's Ruby Library
require 'sendgrid-ruby'
include SendGrid

from = '')
to = '')
subject = 'Sending with SendGrid is Fun'
content = 'text/plain', value: 'and easy to do anywhere, even with Ruby')
mail =, subject, to, content)

response = sg.client.mail._('send').post(request_body: mail.to_json)
puts response.status_code
puts response.body
puts response.headers
# using SendGrid's Python Library
import os
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail

message = Mail(
    subject='Sending with Twilio SendGrid is Fun',
    html_content='and easy to do anywhere, even with Python')
    sg = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
    response = sg.send(message)
except Exception as e:
// using SendGrid's Java Library
import com.sendgrid.*;

public class Example {
  public static void main(String[] args) throws IOException {
    Email from = new Email("");
    String subject = "Sending with SendGrid is Fun";
    Email to = new Email("");
    Content content = new Content("text/plain", "and easy to do anywhere, even with Java");
    Mail mail = new Mail(from, subject, to, content);

    SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
    Request request = new Request();
    try {
      Response response = sg.api(request);
    } catch (IOException ex) {
      throw ex;
Clearing a path to the inbox
The email ecosystem is complex. Many messages never reach the inbox. Twilio SendGrid is built to solve deliverability challenges so you don't worry about what happens after you trigger an email. We’ll help you maximize your inbox placement with streamlined tools, insightful recommendations, and expert services.
  • Integrate

  • SMTP and API
  • Interactive API docs
  • Setup guide
  • Comprehensive client libraries
  • Technical Support
  • Trusted deliverability and performance

  • Dedicated IP addresses
  • Sender Authentication
  • Email Validation API
  • Suppression Management
  • Purpose-Built Mail Transfer Agent
  • Reputation and Delivery Visibility
  • Email Content Testing
  • Expert Services
  • Actionable analytics

  • Engagement and Feedback Loop Metrics
  • Advanced Statistics
  • Searchable Email Activity
  • Webhooks
  • Productive collaboration

  • Transactional Templates
  • Teammate Invitations
  • API Key Permissions
  • Subuser management
  • Privacy and Security

  • Two-Factor Authentication
  • IP Access Management
  • Security Policies
  • Signed Requests and OAuth for Event Webhook
Use Cases
Twilio SendGrid provides a trusted foundation for remarkable businesses across the globe to drive innovation.
  • Reliability at Scale
    We started sending tens of thousands of emails per day with SendGrid. We’re now sending more than that per minute. Email plays a critical role on our platform and SendGrid provides a vital partnership in ensuring reliable delivery as we scale.”
    Prakash Janakiraman, Co-Founder & Chief Architect
  • Deliverability
    By no stretch of the imagination, SendGrid is our most important vendor. If you’re serious and committed to email, and you want to be in control of your email program, you should go for SendGrid.”
    John Havel, Co-Founder