caminator Posted March 9, 2006 Share Posted March 9, 2006 I have an HTML form that is being used as a Contat Us form. I want it to email me the data. Can someone help with how to do that with PHP?? I have it redirecting to a site that says "thanks for contacting us"....and shows the data they entered. Can I set it up so it will email the contents AND still go to this other page? Here is my form code. Thanks![!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<form action="http://www.caminator.com/contact/sendfeedback.php" name="Contact" method="POST"> <div align="center" style="font:Arial; font-size:16px;"> <input type="radio" name="type" id="Praise" value="Praise" checked="checked">Praise <input type="radio" name="type" id="Complaint" value="Complaint">Complaint <input type="radio" name="type" id="Problem" value="Problem">Problem <input type="radio" name="type" id="Suggestion" value="Suggestion">Suggestion </div> <div class="contact_form"> <table border="0" cellpadding="0" cellspacing="0" width="80%" id="AutoNumber5"> <tr> <td width="10%" align="right" valign="top"><font size="2">Name :</font></td> <td width="90%" valign="top"> <input type="text" name="name" MAXLENGTH="25" size="40"></td> </tr> <tr> <td width="10%" align="right" valign="top"><font size="2">E-mail :</font></td> <td width="90%" valign="top"> <input type="text" name="email" MAXLENGTH="40" size="40"></td> </tr> <tr> <td width="10%" align="right" valign="top"><font size="2">Subject :</font></td> <td width="90%" valign="top"> <input type="text" name="subject" MAXLENGTH="50" size="40"></td> </tr> <tr> <td width="10%" align="right" valign="top" colspan="2"> </td> </tr> <tr> <td width="10%" align="right" valign="top"><font size="2">Message :</font></td> <td width="90%" valign="top"> <textarea cols="40" rows="6" name="message"></textarea></td> </tr> <tr> <td colspan="2"></td> </tr> <tr> <td width="20%" align="right" valign="top"></td> <td valign="top" width="30%"> <input type="submit" value="Send Feedback"> <input type="reset" value="Clear"></td> </tr> </table> </div></form>[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/4553-email-form/ Share on other sites More sharing options...
Gaia Posted March 9, 2006 Share Posted March 9, 2006 The PHP mail() function is what you are looking for [a href=\"http://ca3.php.net/manual/en/ref.mail.php\" target=\"_blank\"]http://ca3.php.net/manual/en/ref.mail.php[/a]Just integrate the mail() function in your sendfeedback.php file and it will still display the message. Quote Link to comment https://forums.phpfreaks.com/topic/4553-email-form/#findComment-15950 Share on other sites More sharing options...
caminator Posted March 9, 2006 Author Share Posted March 9, 2006 [!--quoteo(post=353431:date=Mar 9 2006, 04:35 PM:name=Gaia)--][div class=\'quotetop\']QUOTE(Gaia @ Mar 9 2006, 04:35 PM) [snapback]353431[/snapback][/div][div class=\'quotemain\'][!--quotec--]The PHP mail() function is what you are looking for [a href=\"http://ca3.php.net/manual/en/ref.mail.php\" target=\"_blank\"]http://ca3.php.net/manual/en/ref.mail.php[/a]Just integrate the mail() function in your sendfeedback.php file and it will still display the message.[/quote]I appreciate the reply, but I'm way to much of a beginner to be able to follow it. I did get this much out of the link you sent me. Am I anywhere close to where I need to be?[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?php$to = 'cameron@caminator.com, blueair23@caminator.com';$subject = 'the subject';$message = 'hello';$headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();mail($to, $subject, $message, $headers);?> [/quote] Quote Link to comment https://forums.phpfreaks.com/topic/4553-email-form/#findComment-15960 Share on other sites More sharing options...
Gaia Posted March 10, 2006 Share Posted March 10, 2006 looks good to me. Just pop that into your .php file and see if you get anything sent to your inbox. Quote Link to comment https://forums.phpfreaks.com/topic/4553-email-form/#findComment-15963 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.