Make contact form and send email in PHP

posted on July 3, 2006, 12:04 am
Comments
Coert Kastelein posted on October 17, 2009, 2:50 am
Thank you very much for this !
Works fine but you should update to XHTML 1.0+

pete posted on October 16, 2009, 2:18 pm
This appears at the top of my browser page

'') { $ToEmail = 'alethea@aletheacarey.co.uk'; $EmailSubject = 'Site contact form '; $mailheader = "From: ".$_POST["email"]."rn"; $mailheader .= "Reply-To: ".$_POST["email"]."rn"; $mailheader .= "Content-type: text/html; charset=iso-8859-1rn"; $MESSAGE_BODY = "Name: ".$_POST["name"]."
"; $MESSAGE_BODY .= "Email: ".$_POST["email"]."
"; $MESSAGE_BODY .= "Comment: ".nl2br($_POST["comment"])."
"; mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); ?> Your message was sent

Why??

ece posted on October 10, 2009, 7:03 pm
Its not working. This appears over the form:


'') { $ToEmail = 'youremail@site.com'; $EmailSubject = 'Site contact form '; $mailheader = "From: ".$_POST["email"]."rn"; $mailheader .= "Reply-To: ".$_POST["email"]."rn"; $mailheader .= "Content-type: text/html; charset=iso-8859-1rn"; $MESSAGE_BODY = "Name: ".$_POST["name"]."
"; $MESSAGE_BODY .= "Email: ".$_POST["email"]."
"; $MESSAGE_BODY .= "Comment: ".nl2br($_POST["comment"])."
"; mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); ?> Your message was sent

how can I fix it? someone please reply...

Metaferia posted on October 10, 2009, 4:52 pm
Thx, the code is working :)

Meshack posted on October 2, 2009, 7:05 am
Sorry to bother you again...
After tried again im having this code error.

Warning: Unknown error in c:phpdev5wwwphp-email-formemail-thankyou.php on line 11
Failure

It is at
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");

can you help me...

thanks.

Meshack posted on October 2, 2009, 6:51 am
hai, thanks for the code.

When I hit send it gives me the message that it has been sent, but I have not received the email yet.
Can I send the Email of the Form to a Yahoo or Gmail as receiver's address?

thanks.

twistedpixels posted on September 20, 2009, 6:08 pm
thank you, the code works perfectly (I used MAMP for testing). thanks, that was a live safer ^.^

chau posted on August 8, 2009, 3:58 am
I just tried this tutorial and when I hit send it gives me the message that it has been sent, but I have not received the email yet. help help help


aswnai posted on August 4, 2009, 10:28 am
Can I send the Email of the Form to a Yahoo Mail Account?

Vinay posted on August 3, 2009, 11:14 am
i want to add cc in the php code contact form, please help me out

Pages:   1   2   3   4   5   6   7   8   9   10   
   
If you have any additions, suggestions or modifications for this example please contact us or use the form below.
   
Your name:
Your email: (email address will not be posted on the web site)
Comment:
Verification