Email for Developers: A Survival Guide

Brent Sleeper
Jul. 18, 2016 by Brent Sleeper

Email for Developers: A Survival Guide

Making Email for Developers Easier

Back when I was a fresh-faced young web developer (just how much younger, I’ll leave to your imagination, though the fact that I was working with a Perl CGI script on a Netscape web server might give you some idea…), I was given the task of writing a script that would accept an email address from a web form and auto-reply an email with some bit of information (a thank-you note, if I recall correctly).

For obvious reasons, my script needed to parse the submitted data to make sure the user had entered a valid email address. Easy, I thought; the regular expression was going to be really straight-forward. I think I came up with something like “ \w+@[\w\.]+ ” After I had built out enough code to get a working demo, I showed the senior programmer on our team my work. He just shook his head, and promptly schooled me on how sloppy my assumptions were and showed me why my regex was many orders of magnitude insufficient. If you’ve ever tried to grep email addresses, you know how hard it is to write a regular expression that covers all of the bizarre edge cases.

Fast forward to today, and you can understand why I lol-ed reading the title of a blog post written by a developer a few years ago: “I Knew How to Validate an Email Address Until I Read the RFC.” The more things change…

The task of grepping a valid email address neatly captures the exasperation that nearly every developer who works with email has felt at some point. There’s really no getting around it: email can be a pretty strange beast with conventions, dependencies, and quirks unlike anything else, and many of us have a love/hate relationship with making it work. We love email because it’s ubiquitous, open, flexible, and effective; we hate—or perhaps have learned to treat it with a wary respect—because getting an email from point A to inbox B has so many variables outside our control. In short, it’s easy to feel like “I Knew How Email Worked Until I Started to Build an App that Sends Email.”

Fortunately, services like SparkPost let developers offload the operational considerations of building and hosting email infrastructure. We deal with the challenges of sending email at scale, the arcana of sender authentication, and the weeds of email deliverability so you don’t have to.

But even so, if you’re building email into your app or business process, email presents a number of messy details and idiosyncrasies that turn out to be gotchas for many developers. So, to save you a little bit of grief as you dig into the quirks of email, check out “The Developer’s Survival Guide to Email.” It’s an easy read that highlights 10 things builders new to email might not realize about implementing and sending email (and gives some great tips for solving them) – email for developers!

Let me know what you think. What are some of the things that surprised you about email as you began working with it? I’d love to hear about the challenges (and solutions!) you found.


Share your Thoughts

Your email address will not be published.

Related Content

Calm Your Suppression List Anxieties with Python

Learn how to use Python to manage your suppression lists to avoid sending to stale, unsubscribed, bounced emails.

read more

Archiving Emails: A How-To Guide for Tracking Sent Mail

Many senders need the ability to archive sent emails to refer back to later. Here’s a sample app one of our engineers built to assist in archiving emails.

read more

Getting Started with SparkPost in Java

A quick and easy guide on how to use the SparkPost Java Client Library to integrate with SparkPost to allow users to send emails faster.

read more

Start sending email in minutes!

The world’s most powerful email delivery solution is now yours in a developer-friendly, quick to set up cloud service. Open a SparkPost account today and get started for free.

Get Started

Send this to a friend