lazerbrains Posted March 20, 2012 Share Posted March 20, 2012 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 More sharing options...
asevie Posted March 20, 2012 Share Posted March 20, 2012 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>"; Link to comment https://forums.phpfreaks.com/topic/259353-simple-confirmation-email/#findComment-1329537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.