1

I have a web site that provides daily real estate updates. Users register, and we send them an email every day. However, Gmail is marking all of our emails as spam. What should we be looking out for?

SyntaX
  • 2,090
  • 17
  • 30
  • yes it happens with many sites. until few users start to mark them inbox it will start coming in inbox in future for all users as for outlook they have machine learning that checks all these things and analyze correctly – Shan Khan Nov 13 '15 at 11:05
  • Send the emails out using a third party mail provider rather than PHP's internal mail() function. – Simba Nov 13 '15 at 11:26
  • Let me know if my answer satisfies your question. If so, please accept it – SyntaX Nov 14 '15 at 04:09

2 Answers2

2

Spam emails are based on Server, domain and blacklist history.

This is controlled by the Service Provider there is not a lot you can do to be honest.

The best thing is is to add the sender email to your safe list i.e. no-reply@example.com

CiaranSynnott
  • 908
  • 5
  • 9
0

Due to the simplicity of PHP, it is very easy to send a mail through mail(), however there is 99% of chances that you are doing it wrong. You need to follow the right guidelines to use mail(). My recommendation is use a third party mail service like Mandrill

If you still choose to go ahead with php mail(), please follow the below guidelines, which will help you to certain extend.

Set the right Headers:

 $headers .= 'From: YourLogoName info@domain.com' . "\r\n" ;
 $headers .= 'Reply-To: '. $to . "\r\n" ;
 $headers .='X-Mailer: PHP/' . phpversion();
 $headers .= "MIME-Version: 1.0\r\n";
 $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

 $to = to@hello.com;
 $subject = subject ;
 $body = "<div> Email body goes here.. </div>";  
 mail($to, $subject, $body,$headers);

Message Sender Domain and Server Domain Should Match

Spammers are notorious for sending emails from one server and trying to make the recipient believe that it came from somewhere else. So if you are sending an email from sender@yourdomain.com, it is a good idea the the script reside on example.com.

The Server is not Blacklisted

When a server is blacklisted, it means that that server has identified as one that has been sending a lot of spam. This results in recipient mail servers rejecting or filtering any mail that is received from that server.

SyntaX
  • 2,090
  • 17
  • 30