Pages

Feb 18, 2016

PHP mail send with correct from address

PHP mail send with correct from address



<?php
function mailing($to,$subject,$message)
{
$head='<html><body><div><div style=” padding:25px 0px 30px 40px; width:100%;background:#fff;”><div>TEST</div></body></html>';
$header = ‘From: contact@yourdomain.com’ . “\r\n”;
$headers .= ‘Reply-To: contact@yourdomain.com’ . “\r\n” ;
$headers .= ‘X-Mailer: PHP/’ . phpversion();
$headers .= “MIME-Version: 1.0″ . “\r\n”;
$headers .= “Content-type:text/html;charset=iso-8859-1″ . “\r\n”;
$reply=$head.$message.$foo;
mail($to,$subject,$reply,$headers,’-f contact@yourdomain.com’);
}
?>

No comments: