Jump to content

how can I test php mail?


wright67uk

Recommended Posts

What is the best way to test an email has been sent when using php mail?

 

I need to add a mysql update, but I need to test that the email has definitely been sent.

 

Is it good enough to put the below code into an IF block?



 $to      = $user_email;
 $subject = 'A reminder from TNT';
 $message = $info_msg;
 $headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

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

// if mail sent then do this...
Link to comment
https://forums.phpfreaks.com/topic/277679-how-can-i-test-php-mail/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.