Store
Community Documentation

v3 Knowledgebase

Using Mandrill for your Site Transactional Mail

Using Mandrill for your Site Transactional Mail

First you need an account at mandrill:

http://mandrill.com/

Once you sign up, the next screen asks if you want to use SMTP or API method. With the API method, you have more control so that is how mine is set up.

It's best to set up an app for each domain you have, in case you have more than one domain.

This is where to set up the API keys,

https://mandrillapp.com/settings/index/

Click Add API Key

It immediately adds one but you are not done. On the right click Edit for this API key.

Add a description, I use my site name so that I know what this key is for.

Now also under the description click the checkbox for:

Only Allow This Key To Use Certain API Calls

Now click the checkbox at the top of the Message column and it will check all of the things under Messages. This is for extra security.

At the bottom left click to Save Edits.

Make a key for each domain you have.

Once you have your API keys, if you have more than one domain, you would want to make a subaccount for each one including your main site. You can skip this step if you only have one domain.

To make a subaccount go here:

https://mandrillapp.com/subaccounts

Click Create a Subaccount

Make your subaccount ID something relevant. I use the sitename

Now you will see this account has it's own quota and reputation. This is a very nice feature and you'll see why as time goes by.

Once you make all of your subaccounts, you need to make a rule for each one, noting to put the proper IP for each rule.

https://mandrillapp.com/rules

Click to Add Rule

Make a relevant rule name. Again I use the site name.

mandrillrules.png

Set it up like the screen shot shows. It will go for the API for this domain, and the subaccount for this domain. This will have any mail set for the proper domain and filter it accordingly.

Be sure to submit it when done.

Make a rule for each subaccount.

Now you have your app set up on Mandrill for the most part.

You can set the SPF and DKIM records which make it even more reliable for delivery.

https://mandrillapp.com/settings/sending-domains

You'll see any domains here that send from your mandrill account. Stuff is added automatically to it if the sender is your domain.

When you first set this up though, no domains will be there. You can add your domain manually by clicking to Add Domain.

Once your domain (s) is in the sending domains page, you will notice two columns - DKIM Settings and SPF Settings which will show as a red x and missing until you have your server folks change the settings. Just click on each one to see what to send to your host to change. This is not mandatory but it does help and is recommended to do for each domain.

On this same screen is a Verify Domain at the top right. Click that and verify each domain you want to, as an extra measure of protection for your account reputation.

Now to set things up on your PHPFox site. You can go back to your api screen in order to have the info you need to set up in your mail settings, https://mandrillapp.com/settings/index .

At the top is the box that shows your SMTP log in credentials that you need to enter at your PHPFox site. The API key you made is the password.

Go to your PHPFox site, log in as admin and go to AdminCP >> Settings >> Manage Settings >> Mail

Send Mail Method: select SMTP

SMTP Host: (just click to Copy the host name in the Mandrill screen and paste it here)

SMTP Authentication: True

SMTP Username: (just click to Copy the host name in the Mandrill screen and paste it here)

SMTP Password: (Copy and paste your API key here)

Use DNSCheck in email validation: Leave this at false as it slows the site.

SMTP Port: (just click to Copy the Port in the Mandrill screen and paste it here)

click Submit when done and you should receive a site test SMTP email if all went well.

A few tips:

1. At Mandrill, if you don't want your user name to be your email address, just click to the left of the gear at the top right of the screen and edit your account. (it will be a drop down where you see your current user name).

2. Explore Mandrill as it has tons of cool features.

3. Don't use it for a newsletter right away as there is a warm up period and you can see your current reputation as well as your mail quota on the dash page. Be sure to check each domain you set up too if you have subaccounts. Let your account get a good reputation and good quota before sending newsletters.

4. Check your bounces each day or at least every few days, don't wait longer than a week to check your bounces. If you find mail bouncing back, go in your user settings in your site admincp and look for that user with the bounces. Change their settings in the user edit screen so they don't get any site notifications so that your bounce rate will go back down. It's important to keep up with bounces if you want a good reputation.

This is a great tool to use for site email but if abused, it will bite you as you will lose your account. Make sure you don't allow this to ever be used for spamming activities.