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\mail.php on line 7
my php.ini file has..
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
and my php code is
Expand|Select|Wrap|Line Numbers
- <?php
- $to = "someone@example.com";
- $subject = "Test mail";
- $message = "Hello! This is a simple email message.";
- $from = "someonelse@example.com";
- $headers = "From: $from";
- mail($to,$subject,$message,$headers);
- echo "Mail Sent.";
- ?>
please let me know what is the problem