2

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("test.user@gmail.com", $headers, $body); ?>
Rees
  • 1,757
  • 9
  • 33
  • 50
  • 1
    Possible duplicate of http://stackoverflow.com/questions/2032552/php-mail-sends-straight-to-spam-box or http://stackoverflow.com/questions/2032286/why-are-all-mails-sent-via-phps-mail-go-to-spam-box-but-not-mails-sent-directl – Matthew Flaschen Apr 04 '10 at 01:58

3 Answers3

3

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.

Amber
  • 507,862
  • 82
  • 626
  • 550
  • Hi Dav, thanks for your help in this. I'm considering getting a dedicated IP now (to avoid the reverse DNS flag for spam), if I did get a dedicated IP, will that generally ensure that I will definitely be able to send outgoing without it being marked as spam for most inbox's? – Rees Apr 10 '10 at 15:11
  • If you take the appropriate steps (making sure it's marked as okay on lists like Spamhaus, properly setting up the reverse dns, et cetera), then most people should receive it fine. – Amber Apr 10 '10 at 21:01
1

How to increase the chance that the receiver doesn't mark an email as spam has been discussed quite some times here on SO. E.g.

How do you make sure email you send programmatically is not automatically marked as spam?

But there may be some tips specific to pear's Mail package on how to implement these steps (so I wouldn't consider this a duplicate ...yet).

Community
  • 1
  • 1
VolkerK
  • 95,432
  • 20
  • 163
  • 226
1

You can purchase a dedicated IP address for your domain to patch this problem almost. After installing a dedicated static IP,all your email will have unique permanent sender ID...

GMail and other top mail services will list your email in Inbox...But yahoo and some other won't mind it....

FernFox
  • 11
  • 1