Setting Up Your Email Infrastructure With Twilio SendGrid

Setting Up Your Email Infrastructure With Twilio SendGrid

Chapter 1: Introduction 

If you’ve decided that outsourcing your email infrastructure to a cloud-based solution like Twilio SendGrid is the right way to handle your organization’s email needs, that’s wonderful!

Luckily, Twilio SendGrid makes account creation and setup easy. In this guide, we’ll cover a few more decisions you’ll need to make about your email program. You’ll find:

  • Steps you should take when setting up your infrastructure
  • Next steps to take when you’re ready to send
  • Where you can go to get help if you need it

If you’re still evaluating the build vs. decision for your email infrastructure, not to worry, check out our guide, Your Guide to Email Infrastructure Build It or Buy It? It offers a comprehensive look at all of the factors to consider when making this decision.

Chapter 2: How will you send email?

Twilio SendGrid can be used in a few different ways depending on your business needs:

API

You can use Twilio SendGrid’s REST API to send emails programmatically. Our APIs are built on HTTP and return JSON for straightforward implementation.

Once you’ve created your account, you can use Twilio SendGrid’s API endpoint to request to send your email along with the contents of the message. Twilio SendGrid then processes the request and passes the message to the recipient’s inbox provider and gives you a response of whether the message was accepted or not.

Twilio SendGrid has optimized integration tools including open source libraries in 7 languages, interactive API reference, and clear setup flow so you can get your first email out in 5 minutes or less. We recommend senders use the API because it’s fast and easy to use. 

Learn more about integrating and using our API in the

API documentation

SMTP Relay

Unlike the API, when you use SMTP to connect to Twilio SendGrid, separate pieces of information must be passed back and forth between Twilio SendGrid and your servers before the message can be processed and sent to the recipient inbox provider.

While SMTP does take more time and has additional points of failure, it is also a standardized email protocol used universally. For customers who are unable to use the API, SMTP is a perfectly acceptable option.

Learn more about SMTP in our educational blog post, SMTP Service Crash Course.

Marketing Campaigns

Finally, if you’re sending an email to multiple recipients at the same time, you can use Twilio SendGrid’s user interface to upload contacts, design templates, schedule email campaigns, and send bulk emails for all-contact communications like privacy updates. Twilio SendGrid designed Marketing Campaigns so that marketers and developers alike can create the best marketing emails possible.

With all emails sent from the same platform, you eliminate the need to pull data from multiple places while also making your overall email program that much more streamlined.

To learn more about the basics of Marketing Campaigns, watch a demo of the platform, or, to get a more technical walkthrough, you can check out the Marketing Campaign’s User Guide.  

Chapter 3: Determining Your IP Needs

Once you’ve decided how you’re going to integrate and use Twilio SendGrid, you’ll need to determine if you need a dedicated IP. Depending on the amount of email you’re going to send, more than one IP may be appropriate for your program.

Twilio SendGrid’s Pro Plan, ideal for businesses that send 100,000 and up to 1.5 million emails per month, offers a dedicated IP address.

Best practice tip:

A dedicated IP address allows you take responsibility for your sending reputation.


By being in control of your dedicated IP and your reputation, it's more likely that messages are delivered to recipient inboxes correctly.

For more information on IP addresses, from how many IPs you should have for your email volume to how to add on a dedicated IP at Twilio SendGrid, take a look at our docs page, Dedicated IP Addresses

Chapter 4: Authentication Basics

Once you’ve established your email infrastructure, you need to authenticate your email. Email authentication encompasses all validation techniques you use to show inbox providers that the email coming from you is actually yours. The three most important authentication techniques you should use are:

To learn more about domain authentication and how to set it up in your Twilio SendGrid account, please visit our article, How to Set Up Domain Authentication.

Chapter 5: Warming Up Your Configuration

Not long ago, the concept of warm-up referred only to your IP address. Today, spam filters and inbox providers think about warm up in terms of your whole sending configuration. These days, when senders think about warm up, they have to consider their IP, DKIM, domain, from address, and even the content.

Inbox providers default to placing mail streams in the junk or spam folders to protect recipients. It’s important for all senders to go through a warm-up phase to introduce your IPs, domains, and your messages to inbox providers to show them that they’re legitimate and wanted.

Best practice tip:

To properly warm-up your new sending resource (IP, DKIM, domain), send a very small amount of traffic for the first several sends.


Start with your most engaged recipients and gradually increase volume from there. A very cautious warm-up shouldn’t take more than 30 days. An aggressive warm-up can be done in about 7.

Learn more about the IP warm-up process in our Email Guide for IP Warm Up.

Chapter 6: Segmenting Your Email

For senders who want to ensure their mail is delivered correctly, another step they can take is separating the types of email they’re sending into two buckets:

If you send all email from the same IP and the same “from” address, customers who unsubscribe from promotional emails (or report them as spam) may end up not receiving future receipts or password resets they want and need.

To prevent this from happening, you can create a subuser within your Twilio SendGrid account and then add another dedicated IP. By doing that, you can send all your promotional messages from your main account, and then all your transactional messages from a separate IP and subuser. You should also consider sending transactional messages from a different “from” address.

This easy separation of mail streams will keep your transactional mail reputation intact, and prevent recipients from unintentionally missing out on important messages. For more advanced senders, you can add as many subusers and IPs as you like so that even individual email campaigns are sent from their own IPs.  

Read about the latest in segmenting strategy in our guide,

The essential guide to email segmentation

Chapter 7: Address Collection

One of the biggest problems senders run into when beginning a new campaign is sending to a list of email addresses that they either purchased, used in previous businesses, crawled from social media, or have acquired from a partner, affiliate, or associate.

These practices can wreak havoc on your infrastructure because the people on those lists haven’t shown interest in your new email program, and they may find your email unwanted and intrusive.

Best practice tip:

Don't send email to people who don't want it or don't expect it.


Your email is a guest in your recipients’ inboxes. If you’re sending email to people who did not choose to receive your email, they will mark it as spam which will negatively impact your reputation. With a bad reputation, no matter how well you’ve set up your infrastructure or authenticated your email, you won’t get inboxed well.

The best thing to do is grow an email list from the ground up and set expectations as you go. Learn more about email list best practices in our blog post, 3 Reasons Why You Shouldn’t Buy Email Lists.

Chapter 8: Get the Help You Need

Twilio SendGrid is here to help you correct your deliverability problems or answer any other email questions you may have. The resources below are designed to answer technical and non-technical questions alike:

Blog

Twilio SendGrid’s blog, The Full Send, is continuously updated with best practices, trends, and email examples. Visit the blog to answer your questions best practices, product, and technical questions. You can also subscribe to the blog to stay updated on all things email related.

Knowledge Center

The Twilio SendGrid Knowledge Center has nearly everything you need to get your email program off the ground. If you can’t find what you’re looking for in the menu, simply use the search function to find the topic that best answers your question.

Expert Services

If you want to avoid email deliverability pitfalls with your complex email setup, consider partnering with our in-house team of email experts. Our experts will help you efficiently navigate your technical configuration, provide customer account architecture and IP warm-up plans based on your unique sending needs, help train you and your team on the SendGrid UI, and more.

Support

The Support team is available to customers 24×7 and is capable of answering any Twilio SendGrid-related issue. Whether you need a step-by-step walkthrough on how to set up sender authentication or you have billing issues, you can contact Twilio SendGrid Support for help.  

Interested in expanding your developer toolkit? Twilio offers communication channels like voice, text, chat, and video by making the world’s telecommunication structure accessible through APIs.

Explore what you can build with Twilio

Get Started with SendGrid

SendGrid helps you focus on your business without the cost and complexity of owning and maintaining an email infrastructure. And with a full-featured marketing email service that offers a flexible workflow, powerful list segmentation, and actionable analytics, all of your email needs are met in one simple platform.