Does anyone know how can I catch a mail error (error is displayed while sending email and the error is caused by the mailserver down) in php?
Error that was caused b
You could use the PEAR Mail classes and methods, which allows you to check for errors via:
if (PEAR::isError($mail)) { echo("" . $mail->getMessage() . ""); } else { echo("Message successfully sent!"); }
" . $mail->getMessage() . "
Message successfully sent!
You can find an example here.