-1

When I'm sending my mail, it's simple explaied... Ending up in the junkmail at gmail.com.

I know there's multiple other people that has have had this problem. But I've googled for hours and can't seem to solve it. Is there any wrong in my code, or anything I need to add in my code to make it not end up in the junkmail in gmail.com

$to = 'name@gmail.com';
$subject = 'Subject';
$headers = "MIME-Version: 1.0\r\nContent-Type: text/plain; charset=UTF-8";
$headers = 'From: mail@mydomain.com' . "\r\n" . 'Reply-To: mail@mydomain.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
$message = 'my message with consist of multiple' . $variables . ' from php';

mail($to, $subject, $message, $headers);

Could it be the content of my mail? Or what?

1 Answers1

1

This has happened to me as well but seems to only happen when I'm "testing" mail out. As soon as you put real content in there, it most likely won't end up in junk anymore.

dukevin
  • 22,384
  • 36
  • 82
  • 111
  • But the content that I'm sending is the "real" content. I'm basically just sending some information to the email, that comes from different $_POST variables? Maybe adding some text to the mail would help? I'll try that as soon as I come home! – user3151165 Jun 13 '14 at 08:47
  • Certain keywords trigger google's spam filters, things like "test" "mydomain" and random things like that. You said that you are testing the real content, maybe try editing the body a bit to see what words might be triggering it. – dukevin Jun 13 '14 at 12:07