Stop using your SMTP server for email campaigns

EmailAlmost every application nowadays involves sending emails in one or another form. Even the simplest web site will probably require some kind of user management that will send confirmation/forgotten password emails to its users. This can grow to sites sending thousands of emails every month, be it in the form of a newsletter or any other types. A typical approach from developer’s point of view is either to set up a local SMTP server or use a public one (f.x., Gmail). This approach works fine, however it can cause problems when the number of (simultaneous) emails to be sent out increases. Some of the issues are:

  • The email goes into the SPAM folder of the recipient
  • A queuing mechanism needs to be implemented in order to allow multiple emails to be sent out simultaneously
  • An error mechanism needs to be implemented to deal with problems with the SMTP server (f.x., the email is not sent and has to be resent later)

The last two has made developers (including me as well) create separate libraries to cope with the problem. One can also find a lot of these online and adapt them for the concrete case. The first issue however requires some more administrative work, as Jeff Atwood describes in his post.

Outsource your emails

Why not let others take care of you emails? Online services like MailChimp, ActiveCampaign, and Ubivox provide a full set of features to help you deal with email campaigns.

  • Manage lists of recipients
    • Attach metadata to each recipient (f.x., name, age, address)
    • Create filters based on the metadata
  • Manage email templates
    • Use placeholders that are replaced with the metadata of each recipient
    • Reuse templates for different campaigns
  • Dashboard to monitor your campaigns
  • Track email delivery, replies, link clicks
  • A/B testing

Another important aspect is the public API they provide, so you can easily manage everything from within your application. Now basically you will not contact a SMTP server to send your emails anymore, but rather make a JSON request. Furthermore, instead of sending 1000 emails of the same kind, you can use one template with placeholders. This will require only one API request compared to 1000 SMTP calls before.

Forget about campaigns, just send the email

It is true that most of these online services are primarily campaign-oriented. In some cases you would only need to send emails, without the other features. Well, in this case you can rely on similar online services that… only send emails. MailChimp, for example, provides access to its email sending service, called Mandrill. It also has a public API, plus it also supports placeholders in the email, so you can still bundle your emails. SendGrid is also such a services.

Pricing

While using Gmail’s SMTP will most probably be free for you, these online services are paid. Is this a big problem? Mandrill is completely free for up to 12k emails per month. After that it costs $0.20 for every thousand emails for the next 1m emails. You got the idea.

Conclusion

Emails are an everyday necessity, but dealing with them can be problematic. The most important thing is they are received by who is supposed to receive them. If you are a small company (but not only), you would rather leave someone else to take care of this. It saves you time, money, and effort. 🙂