Jump to content

confirmation email php


hoachen

Recommended Posts

I am looking for php tutorials for confirmation email. I want to create a very simple form that contains name: email: phone: When the user click on submit. This user name, email address, phone number will email to my account and at the sametimes, a confirmation email will send to the email address that they fill out. on this confirmation email will "say thank you for filling out the form"I been looking for quite a while but no luck at all. I hope someone done this before and point me to the right place to learn this.thank you very much to whoever try to help.kenny

Link to comment
Share on other sites

I am looking for php tutorials for confirmation email. I want to create a very simple form that contains name:  email:  phone: When the user click on submit. This user name, email address, phone number will email to my account and at the sametimes, a confirmation email will send to the email address that they fill out. on this confirmation email will "say thank you for filling out the form"I been looking for quite a while but no luck at all. I hope someone done this before and point me to the right place to learn this.thank you very much to whoever try to help.kenny

This will do what you want it to (I didn't test it, but it should work :) )... You will need to modify it if you want to add error checking if you want to... I'm working on that part myself right now...
<?php  $name = $_POST['name'];  $phone = $_POST['phone'];  $email = $_POST['email'];  $to = "youremailaddress@yourserver.com";  $subject = "SUBJECT TO YOURSELF HERE";  $subjecttousr = "SUBJECT TO THE USER HERE";  $message = "<b>Name:</b> " . $name . "<br /><br />";  $message .="<b>Phone Number:</b> " . $phonenumber . " <br /><br />";  $message .="<b>Email Address:</b> " . $email . " <br /><br />";  $messagetousr = "Thank you for filling out the form";  $headers="MIME-Version: 1.0\r\n";  $headers.="Content-type: text/html;";  $headers.=" Charset=iso-8859-1 \r\n";  $headers.="From: $email \r\n";   mail ($to, $subject, $message, $headers);   mail ($email, $subjecttousr, $messagetousr, $headers);?>

Link to comment
Share on other sites

Well, your code is fine and working!Thank you very much for your kindness to share!cheers!hoachenThis will do what you want it to (I didn't test it, but it should work :) )... You will need to modify it if you want to add error checking if you want to... I'm working on that part myself right now...

<?php  $name = $_POST['name'];  $phone = $_POST['phone'];  $email = $_POST['email'];  $to = "youremailaddress@yourserver.com";  $subject = "SUBJECT TO YOURSELF HERE";  $subjecttousr = "SUBJECT TO THE USER HERE";  $message = "<b>Name:</b> " . $name . "<br /><br />";  $message .="<b>Phone Number:</b> " . $phonenumber . " <br /><br />";  $message .="<b>Email Address:</b> " . $email . " <br /><br />";  $messagetousr = "Thank you for filling out the form";  $headers="MIME-Version: 1.0\r\n";  $headers.="Content-type: text/html;";  $headers.=" Charset=iso-8859-1 \r\n";  $headers.="From: $email \r\n";   mail ($to, $subject, $message, $headers);   mail ($email, $subjecttousr, $messagetousr, $headers);?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...