PHP email function
Posted: Thu Feb 23, 2012 6:01 am
HI,
I am using the following email function to mail
Im getting the error :
SMTP 127.0.0.1
smtp_port 25
Anyone plz help...
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"; }
?>But mt PHP.ini settings are: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()
SMTP 127.0.0.1
smtp_port 25
Anyone plz help...