Categories
Internet Linux Tips

Email delivery

Almost everyone tends to think that delivering emails is something really easy and pain free.

Well is not.

First time I was sending emails triggered by an action (transactional email), I thought, mmm is pretty easy and it works! Yeah damn fool….easy it is but did the user received the email? does he have it in the spam folder? or maybe never reached him?

Probably transactional email is the easiest since it’s triggered by an action and you make a connection to the email server and you send the email. But the complexity starts when you need to authenticate that email.

Imagine the follow situation, user wants to remember password. Writes his emails hits send. In the server code we connect to the email server (if you are lucky localhost) and then send the email. If your server is not local or is not fast enough this is going to take a while therefore bad user experience. Also there’s a huge amount of variables that makes the IP address of your server to be on a “whitelist” and pray that no one clicks on the SPAM button and then your IP address would be marked as Spam…you are fu***.

It got even funnier when I realized that if you want to send an email with some styling each email software will display it different, so in outlook will be different than gmail or yahoo etc… for that you can use some templates like http://templates.mailchimp.com/ or http://templates.mailchimp.com/.

Since few years  ago every time it’s more difficult to reach the inbox of the user, therefore I am using third party emails providers to use as SMTP relay (google this).

Some examples of services:

Also and not less important all this tools have email tracking loads of stats and unsubscribe services (this is really important),

But what happens if you need to send hundreds of emails, in a transaction?

This could happen, typical example is a forum. You write there and then every time there’s a response to everyone that wrote in that post gets an email notification. If we do that triggered synchronously on new comment it’s going to take ages…

For such actions what I see that most use and I do is a email queue. Everytime an email that can wait 1 or 5 minutes is stored in this queue that we process in batch. So the user experience is not affected and the email may not be sent immediately but close to it.

And newsletters?

This is really a war a part. Probably you send a newsletter with a goal: Sell something. And probably you will try to send it to millions…For example when I was at Privalia.com we used to send 12.000.000 Emails to subscribers per day, this was a really nice challenge.

So I am pretty sure you are going to want some nice statistics example:

  • Who opened the email

  • What time

  • Where did he click

  • How many clicks opens etc..

And you want to be able to put nice images, with good content in an accessible format….

For that you are going to need a proper email newsletter software that does everything for you…you can google a bit, some names like mailchim.com, constantcontact.com, madmini.com, campaigmonitor.com and thousands more…

Note: I am not an expert on email delivery, I hope this helps you as introduction and to see that clearly you will need an email provider 😉