mail() function not working!

April 27, 2011 at 16:33:41
Specs: Windows xp sp2, CPU=466MHz ram=384MB
I have WAMP server 2.0.I want to email my email server running hmail server.
Here is the error:
Warning: mail() [function.mail]: SMTP server response: 550 A valid address is required. in C:\wamp\www\form\file.php on line 14

Here is the code:
file.php:
<?php
$hcomments = $_POST["comments"];
$hname = $_POST["name"];
$hemail = $_POST["email"];
$hoption = $_POST["score"];
$content = "Score:" . $hoption . "Comments:" . $hcomments . "Name:" . $hname;
$to = "laptopdude90";
$subject = "Your site was rated!";
$headers = "From: " . $hname . "<" . $hemail . ">\nReply-To: " . $hemail;


mail( $to, $subject, $content, $headers);
?>

form.html:
<HTML>
<form action="file.php" method="POST">
Name: <input type="text" name="name" size="30" /><br />
email(optional):<input type="text" name="email" /><br />
Additional Comments:
<TEXTAREA ROWS="10" COLS="10" name="comments"></TEXTAREA>

Please rate my site from 1 to 10 (1 = bad and 10 = good): <br />
<select name="score"><br />
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option selected>10</option>
<input type="submit" value="submit" />
</select><br />
</HTML>


See More: mail() function not working!

Report •


#1
April 27, 2011 at 21:48:59
Your email address is incomplete. You need to add @gmail.com or whatever the email's domain is.
http://us2.php.net/manual/en/book.m...

You may also want to add some spaces to the content variable. As is, it will look like this:
Score:1Comments:Hi!Name:Bob

Apologies if I don't respond to your reply immediately. I don't check this site daily, but you're welcome to PM me as a reminder.


Report •

#2
April 28, 2011 at 11:20:20
Nope.Same error.

Report •
Related Solutions


Ask Question