sending email with PHP (preventing from being placed in spam folder)

Rees picture Rees · Apr 4, 2010 · Viewed 10.7k times · Source

i am trying to send email using PHP scripts... however, the recipient is receiving it in his/her SPAM folder -this is not the desired result (I would like to have it sent directly to their inbox so that I don't have to warn them to look in their SPAM folder).

below is the code I use to send the email using PEAR... what changes can I make to prevent the emails from going into the SPAM folder?

send("[email protected]", $headers, $body); ?>

Answer

Amber picture Amber · Apr 4, 2010

In general, email is classified as spam or not spam on the receiving end, not the sending end - otherwise, spammers would simply say that all of their messages aren't spam, completely defeating the purpose. Thus, you can't just force a message to go to a sender's inbox.

However, what you may need to do is see if the machine that you're using to send mail is currently listed on any spam blocklists, and if so, take the necessary steps to remove it from those blocklists. The most common is probably Spamhaus.