Problem with mail() (Windows XP SP3) 1.7.7
Posted: 09. October 2011 16:38
Hallo!!
Please answer me if you Know. There are the followings files in my root Webserver but no email sent it.
In my localhost (XAMPP) everything is OK. Thanks
feedback.html
<html>
<head>
<title>E-Mail Form</title>
</head>
<body>
<form action="sendmail.php" method="POST">
<p><strong>Name:</strong><br> <input type="text" size="25" name="name" /></p>
<p><strong>E-Mail Address:</strong><br />
<input type="text" size="25" name="email" /></p>
<p><strong>Message:</strong><br />
<textarea name="message" cols="30" rows="5"></textarea></p>
<p><input type="submit" value="send" /></p>
</form>
</body>
</html>
--------------------------------------------------------
sendmail.php
<html>
<head>
<title>Sending mail from the form</title>
</head>
<body>
<?php
echo "<p>Thank you, <b>".$_POST["name"]."</b>, for your message!</p>";
echo "<p>Your e-mail address is: <b>".$_POST["email"]."</b>.</p>";
echo "<p>Your message was:<br />";
echo $_POST["message"]."</p>";
//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 = 'mail@1epal-mytil.les.sch.gr';
$subject = "Form Submission Results";
$mailheaders = "From: My Web Site <defaultaddress@yourdomain.com> \n";
$mailheaders .= "Reply-To: ".$_POST["email"];
//send the mail
mail($recipient, $subject, $msg, $mailheaders);
?>
</body>
</html>
Please answer me if you Know. There are the followings files in my root Webserver but no email sent it.
In my localhost (XAMPP) everything is OK. Thanks
feedback.html
<html>
<head>
<title>E-Mail Form</title>
</head>
<body>
<form action="sendmail.php" method="POST">
<p><strong>Name:</strong><br> <input type="text" size="25" name="name" /></p>
<p><strong>E-Mail Address:</strong><br />
<input type="text" size="25" name="email" /></p>
<p><strong>Message:</strong><br />
<textarea name="message" cols="30" rows="5"></textarea></p>
<p><input type="submit" value="send" /></p>
</form>
</body>
</html>
--------------------------------------------------------
sendmail.php
<html>
<head>
<title>Sending mail from the form</title>
</head>
<body>
<?php
echo "<p>Thank you, <b>".$_POST["name"]."</b>, for your message!</p>";
echo "<p>Your e-mail address is: <b>".$_POST["email"]."</b>.</p>";
echo "<p>Your message was:<br />";
echo $_POST["message"]."</p>";
//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 = 'mail@1epal-mytil.les.sch.gr';
$subject = "Form Submission Results";
$mailheaders = "From: My Web Site <defaultaddress@yourdomain.com> \n";
$mailheaders .= "Reply-To: ".$_POST["email"];
//send the mail
mail($recipient, $subject, $msg, $mailheaders);
?>
</body>
</html>