Friday, December 12, 2014

PHP MAIL SCRIPT

//first copy & pste the below two lines.
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\n";

// Here comes your to from cc and bcc values
$headers .= "From: ".$fromemail." <".$fromemail.">\n";
$headers .= "Return-Path: ".$fromemail."\n";
$headers .= "Return-Receipt-To: ".$fromemail."\n";

// then comes priority options and mailer version.
$headers .= "X-Priority: 1(Highest)\n";
$headers .= "X-MSMail-Priority: High\n";
//$headers .= "X-Mailer: php\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
$headers .= "Importance: High\n";

if(mail($toEmail,$subject,$message,$headers)){
    echo 'mail sent';
}else{
    echo 'failed';
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.