Generate email to file without sending

andi4llugiqi

New Member
I want to generate an email using the \[code\]mail()\[/code\] function:\[code\]<?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 filemail($to, $subject, $message, $headers);?>\[/code\]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?
 
Back
Top