SendGrids smtpapi library in Ruby
Clone or download
#53 Compare This branch is 97 commits ahead of eddiezane:master.
mbernier Merge pull request #46 from nvzard/nvzard/32
Replaced .length > 0 with .!empty?
Latest commit bc98ed3 Dec 12, 2017

SendGrid Logo

Build Status Gem Version Email Notifications Badge Gem Version MIT licensed Twitter Follow GitHub contributors

This ruby gem allows you to quickly and more easily generate SendGrid X-SMTPAPI headers.


All updates to this library is documented in our CHANGELOG.

Table of Contents



  • Ruby version 2.2
  • The SendGrid service, starting at the free level

Install Package

Add this line to your application's Gemfile:

gem 'smtpapi'

And then execute:


Or install it yourself as:

gem install smtpapi

Setup Environment Variables

Environment Variable

Update the development environment with your SENDGRID_API_KEY, for example:

echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env

Quick Start

header =
print header.to_json



If you are interested in the future direction of this project, please take a look at our milestones. We would love to hear your feedback.

How to Contribute

We encourage contribution to our libraries, please see our CONTRIBUTING guide for details.

Quick links:


This library was created by Wataru Sato and is now maintained by SendGrid.


smtpapi-ruby is guided and supported by the SendGrid Developer Experience Team.

smtpapi-ruby is maintained and funded by SendGrid, Inc. The names and logos for smtpapi-ruby are trademarks of SendGrid, Inc.


The MIT License (MIT)