Fast2Host Logo

Scripting

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);
?>

 



Maintain peace of mind with 24/7 UK based support

Email any time or call 01480 26 00 00 014 80 26 00 00