PHP Mail Script With The Correct Headers

Correcrt way of telling the MUA the From and Reply-To addresses:


<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

 

Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 12901

Need more information or have a question ?