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? Quote 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>"; Quote Link to comment https://forums.phpfreaks.com/topic/259353-simple-confirmation-email/#findComment-1329537 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.