When I try to send email through Drupal 7 I get an error.
I set up a test script to see if php mail is working:
- Code: Select all
$to = "test@domain.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "TestEmail@FX-Email-Test-Script.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent!";
... and I receive the following error:
- Code: Select all
Warning: 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\site\mail_test.php on line 8
My php.ini settings are as follows:
- Code: Select all
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
In all the times I have used XAMPP I have never had an issue with this.
How do I make php mail work on Win 10 64 bit ?
Thanks!