|
-
Nov 6th, 2009, 03:33 PM
#1
Thread Starter
Lively Member
Contact Form Problem (
Hi guys,
I'm pretty new to php and web development, so naturally I am asking for help with some basic stuff. I created a contact form with php script, and although the php script seems to be working fine( the echo message appears on the screen) I am not able to receive any emails using the form I created. Please look over my code, maybe you can figure out what is wrong with. As always any input is greatly appreciated.
Thanks in advance.
PHP Code:
<?
$subject="from ".$_GET['name'];
$headers= "From: ".$_GET['email']."\n";
$headers.='Content-type: text/html; charset=iso=8859-1';
mail("[email protected]", $subject, "
<html>
<head>
<title>Contact Letter</title>
</head>
<body>
<br>
". "Name: " .$_GET['name']. "<br>" ."Email: " .$_GET['email']. "<br>" ."Message: " .$_GET['message']."
</body>
</html>" , $headers);
echo ("Thank You. Your message to [email protected] was succesfully sent!");
?>
<script>
//resizeTo(300,300)
</script>
and here is the html
HTML Code:
<div class="rtd">
<div class="logo">
<div class="col_2"><br />
<div class="indent">
<!--form id="form" action="" enctype="multipart/form-data"> -->
<form id="form" action="contact.php" method="get" target=”_blank” name="form" >
<div class="b1">
<div>
<input name="name" type="text" value=" Name:" onfocus="this.value=''" />
</div>
<div>
<input name="email" type="text" value=" E-mail:" onfocus="this.value=''" />
</div>
<div></div>
</div>
<div class="b2">
<textarea name="message" cols="30" rows="40" onfocus="this.value=''"> Message:</textarea>
<br />
<div class="tar"><b>
<a href="#" onclick="getElementById('form').reset()">clear</a> <img src="images/spacer.gif" width="35" height="1" alt="qqq" />
<a href="#" onclick="getElementById('form').submit()">send</a></b></div>
</div>
<div class="clear"></div>
</form>
</div>
</div>
</div>
-
Nov 6th, 2009, 04:10 PM
#2
Re: Contact Form Problem (
Tried your sending code (though not your form) and it worked for me.
Stupid question, but sometimes it's the answer: have you checked your "junk" folder at the email you're trying to send to?
Do you know if your host requires authentication for sending emails?
-
Nov 6th, 2009, 04:33 PM
#3
Thread Starter
Lively Member
Re: Contact Form Problem (
Yes, that was the first thing I checked, the junk folder, but to no success. 
I am using yahoo for my host and after reading their policy it doesn't look like they are restricting the email sending by that much.
-
Nov 6th, 2009, 04:42 PM
#4
Re: Contact Form Problem (
-
Nov 6th, 2009, 04:49 PM
#5
Thread Starter
Lively Member
Re: Contact Form Problem (
I think that refers to sending emails from your domain name.
-
Nov 6th, 2009, 05:56 PM
#6
Re: Contact Form Problem (
I'm not sure what you'll need to do here, but I think your problem is with the host. I've tried both your form and mailing code now, and it's sending emails just fine from my domain. :/
-
Nov 6th, 2009, 10:40 PM
#7
Re: Contact Form Problem (
 Originally Posted by oleg
I think that refers to sending emails from your domain name.
they would still be coming "from" your domain anyway -- the "from" field just wouldn't be your domain because you're saying it's from someone else. that doesn't matter though.
your code looks fine, contact your host's support and ask them what's wrong.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|