I am a PHP leaner. I ran a php mail script for testing purpose to result in a warning message. The following are the environment variables , html code , php code and the warning message received when the sript was run. Kindly help me to run the script with out errors
Environment Variables :
Platform : Windows 98;
Apache Version : 2.0.43
Php Version : 4.4.1
Server Name : localhost
Server Addr : 127.0.0.1
Server Port : 80
SMTP : smtp.yahoo.com
SMTP Port : 25
HTML Code :
<html>
<head>
<title> Feed back form </title>
</head
<body>
<form action = "feedback.php" method = "post">
Name : <input type = "text" name = "username" size = "30">
<br><br>
E-mail : <input type = "text" name = "useraddr" size = "30">
<br><br>
<textarea name = "comments" cols = "30" rows = "5">
</textarea><br><br>
<input type = "submit" value = "Send Form">
</form>
</body>
</html>
PHP code :
<?php
$to = "sramu_2000@hotmail.com";
$sub = "Site feedback";
$msg = $POST['comments'];
$addr = $POST['useraddr'];
mail($to,$sub,$msg);
?>
<html>
<head><title>Message Received</title></head>
<body>
<h3>Thanks for your comments </h3>
Message recevied from <?php echo($POST['username']); ?>
<br><br>
Reply to <?php echo($_addr); ?>
</body>
</html>
Output Displayed :
Warning: mail(): Failed to connect to mailserver at "smtp.yahoo.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\srm_php_dev_1\chap10\feedback.php on line 22
Thanks for your comments
Message recevied from Krishna
Thanks