Complete Example of Header PHP Mail Function

3 komentar
This is the Header Setting for PHP Mail Funtion to work correctly.
$headers = "From: info@mydomain.com\r\n";
$headers .= "Message-ID: <" . md5(uniqid(time())) . "@mydomain.com>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "Date: ".date("D, d M Y H:i:s") . " UT\r\n";
$headers .= "Reply-To: info@mydomain.com\r\n";
$headers .= "Return-Path: info@mydomain.com\r\n";
$headers .= "X-Priority: 3\r\nX-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
$headers .= "X-MimeOLE: Produced By MyDomain\r\n";
$success=mail($to, $s_subject, $s_emailmsg, $headers);