1
$headers = '';
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "MIME-Version: 1.0" . "\r\n";
$headers .= "From: $fromName <$from>" . "\n";
$headers .= "Cc: " . "\n";
$headers .= "Bcc: $bcc" . "\n";
$headers .= "Reply-To: successive.testing@gmail.com" . "\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
$success = mail($to, $subject, $body, $headers, '-f reply@xyz.com');

It's working fine when i am sending mail in gmail id but when try to send mail at live, yahoo id then mail going to spam. What reason may be?

René Höhle
  • 26,716
  • 22
  • 73
  • 82
Martin C
  • 395
  • 1
  • 7
  • 21

2 Answers2

0

If it was possible to know what makes an email go to spam, all spam authors would know a way to avoid getting to spam. So really, there's nothing that anyone can say that will prevent your email from going to spam for sure.

In this case, however, I think the biggest problem is you do not use Sender Policy Framework, which proves that the the sender is real.

Since anyone can write anything in the From header, it makes sense why spam filters tend to dislike emails that do not prove their origin.

Denis
  • 5,061
  • 1
  • 20
  • 22
0

You can try adding following

$headers = "From: myplace@example.com\r\n";
$headers .= "Reply-To: myplace2@example.com\r\n";
$headers .= "Return-Path: myplace@example.com\r\n";
$headers .= "CC: sombodyelse@example.com\r\n";
$headers .= "BCC: hidden@example.com\r\n";

These links will help you
http://wiki.apache.org/spamassassin/AvoidingFpsForSenders

http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html

Shafeeque
  • 2,039
  • 2
  • 13
  • 28