Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 28
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
 
 
Register now for full access!
Old 08-24-2009, 12:59 AM Re: Email Form not sending messages
prasanthmj's Avatar
Experienced Talker

Posts: 42
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
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: 28
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
Webmaster Talker

Posts: 744
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>"); 
__________________
34343639363436653237373432303635373837303635363337 34323037343638363137343263323036343639363432303739 366637353366
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.13811 seconds with 12 queries