Customize Each Email with the SMTP API


Posted on

SendGrid API GuideSendGrid has a host of flexible APIs to help you extend and customize the platform to your needs. Included in your API toolbox is the SMTP API. The SMTP API is a header included in messages sent to SendGrid that allows you to use templated messages, deliver custom handling instructions and include increased tracking and analytics information. This is accomplished through an X-SMTPAPI header that is inserted into the message. The header is a JSON encoded list of instructions and options for that email. With the SMTP API, you can do the following:

• Tag your emails so you can get detailed statistics on each tag
• Send multiple customized emails in one request via a mail merge
• Configure each app on a per email basis
• Deliver dynamic content to your recipients in each email
• Customize filtering instructions to control the amount and type of data you receive from each email stream

An example of the above is the use the SMTP API to turn on/off email filters for select email streams. For instance, you can remove unsubscribe functionality from the footer of internal system alert emails and to turn off click through data.

For an in depth review of SMTP integration options, take a look at the SMTP API Developer’s Guide for sample code and information. To learn more about what other APIs are available, download the SendGrid API Guide.


Carly Brantz is a veteran in the email deliverability space working to make email simple and easy for developers by regularly writing whitepapers, research briefs and blog posts about email, technology and industry trends.

Carly Brantz on Twitter
Have thoughts on this post?
Chat with us about it on Twitter and Google+