I just started offering user accounts on my website (large PR6 site, with a good reputation) and I noticed that the registration emails almost always go to the receivers spam box.
So far we have only sent out a few emails, so its not like we've been slamming out thousands.
I send the emails via PHP with the mail() function. Below you can find the headers that i send with the mail() function.
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Domain.com <[email protected]>' . "\r\n";
Is there a way, or a trick to get round these spam filters? Its clearly not spam what I am sending out. The registration email contains 3 links.
There are many things that can cause emails to be flagged as spam. The solution is twofold: On one hand you should be using a good smtp server (deliverability) and then you should be forming your emails correctly. (A daunting task using mail().)
Sending emails correctly using PHP
You should really use something like PHPMailer. It's a php library for sending emails and does them properly, so the emails have a higher chance of reaching correctly.
http://phpmailer.worxware.com/
Email delivery
Email delivery can be a headache, but I can recommend http://www.sendgrid.com - You basically set them up as phpmailer's smtp server and use their outgoing mail server.. They're experts in email deliverability and you'll have a much easier time. Especially when you start sending out hordes of emails.
Code example
Example email from phpmailer's website:
I'd like to say that I'm not affiliated with Sendgrid in any ways. I'm just a big fan of their service. I fought with mail() function, smtp servers, mail queues and services for many years in web dev shop and I do not wish that fate for my worst enemy. Save yourself some time and worries.
Cheers...