Forum Moderators: coopster
The mail function works perfectly, too perfect. If a user submits a blank form, I want an error message to pop up. Instead, the user is still directed to the php document that says, "Thanks for your submission..." It even includes the space where the name would be inserted, had it been filled in.
The "else print..." is the chunk of code that doesn't seem to be working:
if(mail($recepient, $subject, $body, $additional_headers));
else print('There was an error processing your request. Please Try Again.')
?>
Any help would be greatly appreciated.
Mason
You should check for the elements of the mail, and for their correct formatting before invoking the mail() function.
mail() returns TRUE if it is accepted for delivery ... which doesn't mean that there's a "recipient" or a "subject" or a "body" in the function, just that it was accepted into your mail system. Just because it was accepted for delivery doesn't mean it will be delivered. :)