Syndicate content
> PHP Mail Form Script Tutorial : Sending...

PHP Mail Form Script Tutorial : Sending...

Intro
Additional Header Info
An Example Free Script
Sending...


Sending...

Sending the email:

Code:
if (@mail($mailto, $subject, $message)) {

header("Location: $redirect");
}

In this part, if the mailing was successful then the user is redirected to the redirect page specified in the configuration section.

Finally:

Code:
else {
// This echo's the error message if the email did not send.
// You could change the text in between the <p> tags.
echo('<p>Mail could not be sent. Please use your back button to try again.</p>');
}

This final part tells the user if the mailing was not successful by echoing out the message, ?Mail could not be sent. Please use your back button to try again?. Though not the most elegant solution, this is a simple method of error checking and user feedback for the script.

So, C-W-M visitors and members, does this little mail() function explanation make sense?

Talk to me here:
http://www.christian-web-masters.com/forums/viewtopic.php?t=191
Sean Buscay
www.christian-web-masters.comSean Buscay is on a mission to CREATE, ADVANCE, and EXPOUND faith in JESUS using web technology. He is the owner of Christian-Web-Masters.com .

User login

Christian-Web-Masters.com newsletter

Stay informed on our latest news!