sending emails in code

Many application need to send emails at some point or another: either for user confirmation, password reset, newsletters, support and more. Whatever the use-case, sending emails with a transactional email service removes the time and stress of configuring a custom SMTP server.

Remember, it's important to test your email sending functionality end-to-end. MailSlurp is a email test account generation API that lets you create random unique email addresses and then send and receive real emails with them.

What is a transactional email service?

Email sending services are often called transactional mail services as emails are commonly sent on demand after particular application events. This means services typically provide an HTTP API or SDK so that customers request the sending of email from their application.

Benefits of email as a service APIs

Transactional mail services are plentiful and offer many advantages:

  • They are easy to setup (compared with regular SMTP mail servers)
  • Calling APIs is simple in application code (compared with SMTP APIs)
  • They can handle high load and scale
  • Some offer graphical templating systems to make email composition easier

Email sending APIs do have disadvantages too over more traditional email sending techniques:

  • They're mostly paid
  • They all have different API abstractions (so vendor lock-in can occur)

Transactional email services compared

1) PepiPost

PepiPost is really affordable and with good API and SDK clients.

2) SendGrid

SendGrid is a very popular transactional email service from Twilio.

3) MailJet

MailJet is another popular email sending service. Has templating system and analytics.

4) MailGun

MailGun doesn't have UI editing but does have great free plans.

5) PostMark

Easy to send emails with PostMark and interesting analytics features.

6) Elastic Email

ElasticEmail has a fresh take on transactional mail with a nice interface and editor.

7) SendInBlue

Trusted by big brands. Features drag and drop editor plus dedicated IP.

8) Mandrill (MailChimp)

Mandrill is MailChimp's transactional email API. If you already use MailChimp this could be a good option.

9) SparkPost

SparkPost has a great API and good metrics. Trusted by Pinterest.

10) Amazon SES

AWS's Simple Email Service offers powerful APIs for sending emails with code. It requires some AWS experience.

Testing transactional email

Whichever email sending API you choose, make sure you test your email sending and receiving with MailSlurp. MailSlurp let's you generate email addresses and test email sending and receiving programmatically.