If succesful

A

Anonymous

Guest
This is probably something really basic, but here goes anyway. How do I check to see if the mail(); function was succesful, for example, I was to: print("Message succesfully sent!");, if it was succesful.
 
Yes, it works like this :
mail() returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.
Have a look at http://www.php.net/manual/en/function.mail.php

Code:
 if(mail($EMAIL, "$SUBJECT", "$BODY", "From: $REPLY")) {  
            echo "success";  
 }else{
            echo "fail";
 }


bye
:)
 
Back
Top