Wednesday, 21 August 2013

best practice to know whether mail function send mail or not

best practice to know whether mail function send mail or not

I am using the below code snippet to send mail via php mail function.
$mailsent = mail($to_address, $subject, $message, $headers);
if ($mailsent)
return "mail send";
else
return "error";
I am checking the boolean in $mailsent variable to determine whether the
mail is send successfully or not. Is this the right practice to find the
status of mail send by php mail function. Any help will be
appreciated.Thanks

No comments:

Post a Comment