Mail NOT into spam folder

  12:06 am  PHP
<?php

$to = "test@test.com";
$subject = "Test Email";
$message = "Test Email";

// normal headers
$num = md5(time()); 
$headers  = "From: Mailer <mailer@test.com>rn";
$headers  .= "MIME-Version: 1.0rn";
$headers  .= "Content-Type: multipart/mixed; ";
$headers  .= "boundary=".$num."rn";
$headers  .= "--$numrn";

// This two steps to help avoid spam   

$headers .= "Message-ID: <".time()." TheSystem@".$_SERVER['SERVER_NAME'].">rn";
$headers .= "X-Mailer: PHP v".phpversion()."rn";         

// With message

$headers .= "Content-Type: text/html; charset=UTF-8rn";
$headers .= "Content-Transfer-Encoding: 8bitrn";
$headers .= "".$message."n";
$headers .= "--".$num."n"; 


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

?>
Reply
Share a link to this topic
close

Be the first one to reply