Tutorial: Adding CC ME to your PHP email form.

[Posted 11/25/2008 at 7:36 PM | No Comments]

This is a very simple and easy way to make a CC ME in your HTML form. A CC ME is a great tool to have on your website. When the person is filling out the form on your website, give them the ability to copy themselves on the email as well. This way they have your email within their inbox so all they have to do is click on reply instead of coming back to your website.

Take a look at the the Creating a form in PHP and XHTML post I did earlier. Add the following code at the very bottom right above the ?>.


//ccme
if(@$_POST['ccme']){ //the name of the cc me checkbox (cc me)

$user = “”;
$user .= “Thank you for contacting me. I usually reply within 24 hours. “;
$user .= “\n”;
$user .= “You are receiving this email because you clicked on ‘cc me’ within the form you submitted on myself, www.mattginsberg.net.”;
$user .= “\n “;
$user .= “Here are your comments:;
$user .= “\n”;
$user .= $comments;
$user .= “\n”;
$user .= “\n “;
$user .= “Thank you “;
$user .= “Matt”;
$EmailTo = ‘matt@mattginsberg.net ‘; //from me
$from=$_POST['from']; //the name of the email input field on your form
$subject=’Thank you for submitting the form at mattginsberg.net ‘.$_POST['subject'];
mail($from,$subject,$user, “from:<$EmailTo>”);

To make this CC ME come to life, add a checkbox in your website’s form and name it ccme.

Feel free to break this down and ask me any questions if you have any.

Don’t forget to leave comment’s!!!


HELP SPREAD THE WORD!

Random Posts

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Please leave your comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.