Reply
Email Form not sending messages
Old 08-23-2009, 12:35 PM Email Form not sending messages
Average Talker

Posts: 21
Name: Rhowena MacCuish
Trades: 0
Hi Guys

I followed some tutorials online to have an email submit form on my webpage, I get the message sent response but nothing ever comes into the asigned mail box. Can anyone see where I am going wrong?

Here is the code on my html page:

<form id="contact_form" name="contact_form" action="contact.php" method="get">
<label>Name</label>
<br />
<input name="name" type="text" size="50" />
<label><br />
Email Address</label>
<br />
<input name="email" type="text" size="50" />
<label><br />
Comments</label>
<br />
<textarea name="comments" cols="50" rows="10" dir="ltr" lang="en" xml:lang="en"></textarea>
</label>
<br />
<input name="Submit" type="submit" value="Submit" />
</p>
</form>

And here is the code in the PHP file, which is in the same level dir:

<?
$subject="from ".$_GET['name'];
$headers= "From: ".$_GET['email']."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
mail("rhowbust@yahoo.co.uk", $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>

<br>
".$_GET['comments']."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
<script>

//window.close()
</script>
rhowbust is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 08-24-2009, 12:59 AM Re: Email Form not sending messages
prasanthmj's Avatar
Average Talker

Posts: 27
Name: Prasanth
Trades: 0
Try changing the From address to an email address on the same website. For example: name@yourwebsite.com

PHP Code:
$headers"From: name@yourwebsite.com\n";
$headers .= "Reply-To: ".$_GET['email']."\n"
Some servers reject email if the From address does not match the originating host name.
prasanthmj is offline
Reply With Quote
View Public Profile
 
Old 08-27-2009, 12:38 PM Re: Email Form not sending messages
Average Talker

Posts: 21
Name: Rhowena MacCuish
Trades: 0
Hi there, thanks for the tip, but this is still not working.
I now have this:
$subject="from ".$_GET['name'];
$headers= "From: info@utopiagardendesign.co.uk\n";
$headers .= "Reply-To: ".$_GET['email']."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
mail("info@utopiagardendesign.co.uk", $subject, "

Is this correct or not?
Sorry I have not worked much with PHP.
rhowbust is offline
Reply With Quote
View Public Profile
 
Old 08-30-2009, 07:02 AM Re: Email Form not sending messages
lizciz's Avatar
Ultra Talker

Posts: 330
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Try sending a very simple mail and see if that works. Then work your way from there to what you have now and see where it goes wrong.

Also, I don't know exactly what forms for the From header field that works, but I've learned that it should be as in

From: "Your Name" <email@domain.com>

PHP Code:
// Try this
mail("you_email@domain.com""testing""testing""From: \"Your Name\" <email@domain.com>"); 
__________________
596f75206d65616e20796f752063616e2061637475616c6c79 207265616420746869733f
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to Email Form not sending messages
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11532 seconds with 13 queries