Jump to content

Simple confirmation email...


lazerbrains

Recommended Posts

I have been looking everywhere, and can't find a simple example of scripting a confirmation email. Basically, I have a form that is submitting to a database. But when the user submits the form successfully (I already have the validation in place), it sends their submitted email address a confirmation email.

 

Currently the form submits, fills in fields in a database, and sends the user to a static thank you page. At this time I would like to send them the email. How can this be done somewhat simply?

 

Link to comment
https://forums.phpfreaks.com/topic/259353-simple-confirmation-email/
Share on other sites

This is what I use...

 

It comes after the INSERT (assuming you're using mysql)...

 

....

 

$message =

"Thank you for registeringr blah blah. Here are the login details...\n\n

User Name: $_POST[user] \n

Password: $_POST[pass2] \n

 

Thank you. This is an automated response. PLEASE DO NOT REPLY.

";

 

mail($_POST['email'] , "Activation", $message,"From: \"Auto-Response\" <notifications@$host>\r\nX-Mailer: PHP/" . phpversion());

 

echo "<div class=\"error\"><h2>Registration Successful! <small>An activation has been sent to your email address with account details...</small></h2></div>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.