Sending Reliable Emails With Magento

From Moogento How-to Guides
Jump to: navigation, search

We can help you get this setup, just get in touch for a quote :)






Email basics

Background info

Some basics to start with:

  1. PHP (which Magento runs on) used to be able to send emails via one-line of code.
  2. This was a major cause of global spam (as it didn't need a user/pass to send).
  3. Most receiving email servers will now flag any email sent like this as a major spam flag.
    * ie. there's a high chance your emails won't be delivered.
    * If you're also sending (non-Magento) business email with the same sending domain (eg. your-site.com), there's a good chance the delivery of those emails will also be impacted, due to the flagging of other emails.
  4. A lot of hosts will also block emails sent that way from being sent, so that their servers aren't blacklisted.
  5. Default Magento sends emails with this system.
  6. That's right. If you haven't specifically added a way to authenticate (with user & password) the emails you're sending with Magento, then it's likely that both transactional emails from Magento, and your regular company emails, are not all being delivered.

Check your current status

Have a quick check to see if your domain is blacklisted: Email server blacklist checker

Here's an example of a blacklisted email server (this domain will have deliverability issues). email-blacklisted.png

Action plan

Use a separate sub-domain to send emails

You should use a different subdomain for transactional emails, marketing emails, and business emails.

The aim here is if one get's blacklisted, the other ones can carry on.

eg. if your site is example.com then you might want to setup subdomains for:

  1. Optimal:
    1. e.example.com (transactional emails)
    2. e.example.net (marketing emails)
    3. mail.example.com (main biz emails)
  2. Good:
    1. e.example.com (transactional emails)
    2. email.example.com (marketing emails)
    3. example.com (main biz emails)

If you're not familiar with setting up DNS for different subdomains, I recommend checking DnsMadeEasy.com. Your main domain registrar likely also has the ability to setup and direct multiple subdomains.

Check that you can send & receive email at each of those (sub)domains.

Setup an email sending service

You now need to setup an email sending service for your transactional emails (ie. the emails that Magento sends).

These guys ensure the email servers are live, off blacklists, and generally make sure your emails get sent.

I recommend MailGun but there's a bunch out there, eg. Mandrill, SendGrid.

You'll need to configure some settings in your DNS provider (dnsMadeEasy or your domain registrar) to verify your ownership to Mailgun.

Setup Magento to connect to Mailgun

  1. Get Magento connected to your email sender
    * I recommend SMTPpro. It's a free plugin and works great.
  2. Once you've got it installed, head to the config section of that plugin and enter your MailGun settings.
  3. Check it's all working - make a test order, check that you get the correct emails.
  4. Log into MailGun and check the activity, check you see the emails you're expecting to see
    * This is going to be useful in the future if you think you have email delivery issues - you can see exactly what has been sent to who, from Magento.
  5. In your receiving email app (where you are receiving the test transactional emails), look at the raw message contents. Check that everything looks as you want it to, as a representation of your business (eg. sender name, reply-to email, etc).