I am currently using xampp 1.7.0
and my php version is 5.2.8
I changed my php.ini
file to:
[mail function]
; For Win32 only.
SMTP = smtp.gmail.com
smtp_port = 465
and my send_email.php file looks like:
$to = "myemail@gmail.com";
$subject = "Test mail";
$message = "Hello! This is a test message.";
$from = "someonelse@gmail.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
But, it shows the following message:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\NFL\send_email.php on line 15
Line number 15 is:
mail($to,$subject,$message,$headers);
How can I resolve this issue?
Note: I also added a 5th parameter to the mail call to force the system to use the From Email Address, but it didn't worked!