Making sure Outlook.com receives PHP Mail() emails
During the recent development of bethanyjackson.co.uk I had found my current setup of Postfix which is used by PHP Mail() was not sending email correctly to Microsoft email services such as Outlook.com.
Emails were being sent by my web server but never received by Outlook.com or placed in the Junk folder, even though emails were received fine by Gmail with the same server settings.
I found some help on various websites regarding this issue which I have now implemented on my server, I have posted the configuration below which I now working for me.
1. The first step is to check your domain and/or IP address is not listed on a spam block list. Use http://www.spamhaus.org/lookup/ to check for blocked domains and IP addresses. If the domain and/or IP address is listed on a spam block list, then it should be removed.
2. Add a Windows Sender ID SPF record to your domain’s DNS settings. This helps Microsoft services to understand your domain and/or web server IP address is not used for sending spam emails. This can be setup at this web address:
http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/ [Link no longer available: 23/07/2016].
3. Always make sure there is a valid ‘From:<firstname.lastname@example.org>’ address in the headers of your PHP Mail() code. It must be a full email address and not just a domain, an example of the correct script setup is below:
4. Then edit your ‘main.cf’ Postfix file, usually stored in ‘/etc/postfix/’ on your web server. Starting on line 23, your network settings must be the same as below. Replace ‘yourdomain.co.uk’ with your domain name.