Sunday 19 May 2019

php - How can I get the error message for the mail() function?

I've been using the PHP mail() function.



If the mail doesn't send for any reason, I'd like to echo the error message. How would I do that?




Something like



$this_mail = mail('example@example.com', 'My Subject', $message);

if($this_mail) echo 'sent!';
else echo error_message;


Thanks!

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...