Php Mail Received Spam in Gmail – Solved

I Read more forum and blog. Everybody saying Below Option only. I also Tested.
This is working. If anybody want to avoid received spam mail.

kindly check below :

$from = “test@server.com”;
// To send HTML mail, the Content-type header must be set
$headers  = ‘MIME-Version: 1.0’ . “rn”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “rn”;

// Additional headers
$headers .= ‘From: ‘.$first_name.”rn”.
‘Reply-To: ‘.$your_email.”rn” .
‘X-Mailer: PHP/’ . phpversion();

$mail = mail($to, $subject, $full_msg, $headers, “-f $from”);

You can use above Fifth Additional Header Option “-f”. This is solved spam problem in gmail.

Leave a Reply

© 2020 Spirituality