why the mail can not work?
Posted: Sat Aug 23, 2003 10:27 pm
The following is the code of text.php
the following is the code of hidden.php
when I run the program, why it always shows that "could not send mail"
Thanks
Code: Select all
<HTML>
<HEAD>
<TITLE>E-Mail Form</TITLE>
</HEAD>
<BODY>
<FORM action="hidden.php" method="POST">
Your Name: <INPUT type="text" name="name"><br><br>
Your E-Mail Address: <INPUT type="text" name="email"><br><br>
Message:<br>
<textarea name="message" cols=30 rows=5></textarea><br><br>
<INPUT type="submit" value="Send Form">
</FORM>
</BODY>
</HTML>the following is the code of hidden.php
Code: Select all
</head>
<body>
<?php
print "Thank you, <b>$_POSTїname]</b>, for your message!<br><br>\n\n";
print "Your e-mail address is: <b>$_POSTїemail]</b><br><br>\n\n";
print "Your message was:<br><br>\n\n";
print "$_POSTїmessage] <br><br>";
//start building the mail string
$msg = "Name: $_POSTїname]\n";
$msg .= "E-Mail: $_POSTїemail]\n";
$msg .= "Message: $_POSTїmessage]\n";
//set up the mail
$recipient = "yuping-wang@tamu.edu";
$subject = "Form Submission Results";
$mailheaders = "From: My Web Site <defaultaddress@yourdomain.com> \n";
$mailheaders .= "Reply-To: $_POSTїemail]\n\n";
//send the mail
mail($recipient, $subject, $msg, $mailheaders) or print " could not send mail";
?>
</body>
</html>when I run the program, why it always shows that "could not send mail"
Thanks