Jump to content


Photo

Email form


  • Please log in to reply
3 replies to this topic

#1 caminator

caminator
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 09 March 2006 - 08:08 PM

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...ndfeedback.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">&nbsp;<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">&nbsp;<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">&nbsp;<input type="text" name="subject" MAXLENGTH="50" size="40"></td>
</tr>
<tr>
<td width="10%" align="right" valign="top" colspan="2">&nbsp;</td>
</tr>
<tr>
<td width="10%" align="right" valign="top"><font size="2">Message :</font></td>
<td width="90%" valign="top">&nbsp;<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%">&nbsp;<input type="submit" value="Send Feedback">&nbsp;<input type="reset" value="Clear"></td>
</tr>
</table>
</div>
</form>[/quote]

#2 Gaia

Gaia
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts
  • LocationCanada

Posted 09 March 2006 - 11:35 PM

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.

#3 caminator

caminator
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 09 March 2006 - 11:58 PM

[!--quoteo(post=353431:date=Mar 9 2006, 04:35 PM:name=Gaia)--][div class=\'quotetop\']QUOTE(Gaia @ Mar 9 2006, 04:35 PM) View Post[/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]



#4 Gaia

Gaia
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts
  • LocationCanada

Posted 10 March 2006 - 12:00 AM

looks good to me. Just pop that into your .php file and see if you get anything sent to your inbox.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users