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
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>";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.