I am using the following email function to mail
- Code: Select all
<?php
$to = "xxx@xxx.com";
$subject = "test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From:" . $from;
if(mail($to,$subject,$message,$headers))
{ echo "Mail sent"; }
else
{ echo "Mail failed"; }
?>
Im getting the error :
Warning: mail() [function.mail]: Failed to connect to mailserver at "127.0.0.1" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
But mt PHP.ini settings are:
SMTP 127.0.0.1
smtp_port 25
Anyone plz help...

