I want to generate an email using the mail()
function:
<?php
$to = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
// instead of sending mail, out put to file
mail($to, $subject, $message, $headers);
?>
But instead of having it actually send the email, I want it to output the email to file with all of the headers etc. as a mail server would see it. Is this possible?