Related articles

No items found.
The French newsletter for Ruby on Rails developers. Find similar content for free every month in your inbox!
Register
Share:
Blog
>

Evaluate the deliverability of your automatic emails

Transactional emails are a way to strengthen the relationship between your platform and your users. They can even be critical in the proper functioning of your platform. Take the basic example of an account confirmation email; if the user does not receive it then he will not be able to complete his registration.

This article attempts to draw up a list of best practices to follow in order to put all the chances on your side so that your automatic or marketing emails do not end up in spam. If you are a web developer, a project manager or simply looking for information on how to assess the deliverability of an email then this article is for you!

Some best practices

Before auditing the quality of your emails, there are a few essential elements to check manually. Especially if you notice that your emails are not reaching their destination.

  • Check the format of email addresses
    Typos are a regular occurrence in the typewritten world. This is therefore also the case for your email addresses. On the one hand, you can protect yourself from these errors by validating the format of the email address. Most browsers offer front-end format validation if you specify that the field is an email field. Of course, server-side reprocessing is also recommended.
  • Make sure you have defined a valid sender
    This error occurs frequently when using a backend development framework such as Rails or Jango. They are generally provided with a fictitious shipping email address such as “change-me-in-the-config-file@fakeemail.com”. This will work in a sandbox environment as long as the emails are not actually sent. This will not be the case in production.
    Tips for RubyOnRails: If you're using the Devise gem, take the time to check the sender set in its initializer.
  • Use a ReplyTo from the same domain
    If you are providing a reply-to address, make sure it belongs to the same domain.
    Take the example of an email sent from “domain.com” with a response address “contact@unautredomaine.com”, there is a good chance that it will be considered spam or at least that it will be delivered with a warning message. This case can be really blocking, especially for Gmail addresses.
  • Differentiate your transactional and marketing emails
    Statistically, marketing email lists will have a higher proportion of spam declarations and hard bounces (email does not exist). In order to avoid that marketing emails that are not critical from negatively impacting your reputation and therefore the deliverability of your transactional emails, use different shipping addresses and IP addresses.
  • Make sure your emails don't contain JavaScript
    JavaScript opens the door to numerous security breaches, so most email boxes block all emails that contain them. So abstain.

Now that we've seen the best practices to check, we can start evaluating the deliverability of an automatic email.

Evaluate the deliverability index of an email

Each time it receives an email, an email client (Gmail, Outlook, Yahoo...) will evaluate this email and assign it a spam score based on a list of defined criteria. The higher this score, the more he will consider the email to be spam.

There are a large number of tools to calculate the spam score of an email. As a project manager in a web development agency I regularly need to calculate this score to make sure that automatic emails from a website will not end up in spam. For this, I use Mail Tester which fulfilled the simple need to calculate the deliverability index of an email based on the most important criteria.

Note: the score provided by Mail Tester is the deliverability index, so it is inversely proportional to the spam score mentioned above.

Mail Tester is very easy to use. When you land on its home page, it directly provides you with a random email address. All you have to do is send the automatic email you want to evaluate. In most properly built web platforms, automatic emails have a common appearance (header, footer, etc.) in which you simply insert content that varies from one email to another. So, testing any automated email is enough to identify global problems.

TIPS: I create an account on the platform or application that I want to test by entering the email provided by Mail-Tester then I trigger a password reset email.

In the example above, the score is quite high, so it is unlikely that the email will end up in spam. Generally speaking, if your grade is between 9 and 10, you probably don't need to change anything. However, if everything was still going well then I would not have written this article so I will continue to list the problems commonly encountered.

Check the DNS signature of your emails

Anybody (with a computer with an internet connection and computer skills) can send an email using any shipping email address, even if it does not belong to him. In order to reduce the risk of phishing, email clients verify the authenticity of an email with 3 signatures provided at the DSN level (in other words the configuration of the domain name used) :

I will not go further in the technical explanations because it is not relevant for this article but if you want to go deeper you will find documentation by following the links above.

The main SMTP server providers (SendinBlue, Mailjet, Mailchimp, Sendgrid, AWS SES...) provide everything you need to set them up. Below are the tutorials for the main providers:

If you don't use any of the SMTP servers listed above, you can easily find the appropriate tutorial on Google.

How to get out of a SPAM blacklist

Being blacklisted is the worst case scenario because getting out of it is quite complex. You then have two options:

Solution 1: Contact the support of the spam lists concerned

and prove to them that your emails are not spam. If you only send transactional emails, you can “simply” explain to them that each email sent is the result of a specific user action on your platform and that they are therefore important for the proper functioning of your platform. This has always worked for me, however the support interfaces for these spam lists are often not very UX-friendly, so it's better to be patient!

In the example above, the email is blacklisted by the RedHawk spam list so you have to go to the List search page (Mail Tester provides the link for you) and enter the IP used (Mail Tester also gave it to you at the top of the section, “54.240.4.5" in the example). You will then be able to see why you are blacklisted or at least the list of spam events. (emails that have been cataloged or declared as spam). With this information, you can either make the necessary corrections or contact support if you consider these events to be irrelevant.

This solution is only possible if you are only blacklisted in a few lists. If you are blacklisted in a large number of lists, this manipulation will be very tedious and time-consuming.

Solution 2: Change your shipping IP address

This solution is often simpler. Depending on your level of subscription to the SMTP provider, you probably use a shared IP to send your emails. This means that if one of the users who shares the IP with you is “spamming” then this may affect you as well. To avoid this, you can ask to benefit from a dedicated IP. The cost varies between €50 and €150 per year depending on your provider. If you do not have blacklist problems or if you do not send a very large quantity of emails, it is not worth taking advantage of such a service. However, be careful to make sure that you have followed all the advice in this article beforehand and to have investigated the reasons that made you appear in this blacklist, otherwise you may risk that this new IP will end up blacklisted as well.

And that's it! Your audit with Mail Tester will potentially highlight other issues such as broken links (404) or image tags that don't have alt attributes, but I won't cover them in this article as they are fairly explicit and easy to fix. Thanks for reading, I hope this article was helpful and clear enough, otherwise feedback is welcome. 🙏