PHP Mail giving error on Win 10 - 64 bit

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP Mail giving error on Win 10 - 64 bit

Postby FreeXEnon » 07. July 2017 16:19

I have a fresh install on XAMPP (3.2.2) on a new 64 bit Win 10 box.
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!
FreeXEnon
 
Posts: 4
Joined: 07. July 2017 16:00
Location: Baraboo, WI
XAMPP version: 3.2.2
Operating System: Win 10 (64 bit)

Re: PHP Mail giving error on Win 10 - 64 bit

Postby Nobbie » 07. July 2017 18:04

You have to setup and configure a full featured SMTP Mail server on your PC. Before you try to setup Mercury or any other server, read this thread: viewtopic.php?f=16&t=75749
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: PHP Mail giving error on Win 10 - 64 bit

Postby FreeXEnon » 07. July 2017 18:06

What is curious to me is that I have not had to do that before when working with XAMPP.
Why is it different here that requires me to do that?
FreeXEnon
 
Posts: 4
Joined: 07. July 2017 16:00
Location: Baraboo, WI
XAMPP version: 3.2.2
Operating System: Win 10 (64 bit)

Re: PHP Mail giving error on Win 10 - 64 bit

Postby FreeXEnon » 25. July 2017 17:41

So, no one knows why this has changed?
I have never had to setup anything different on this or any of my ISP's, the default php mail has always worked until now.

I do not want to add a username and password for a service. It should just send email through php.

Anyone have a clue?
FreeXEnon
 
Posts: 4
Joined: 07. July 2017 16:00
Location: Baraboo, WI
XAMPP version: 3.2.2
Operating System: Win 10 (64 bit)

Re: PHP Mail giving error on Win 10 - 64 bit

Postby Nobbie » 26. July 2017 01:44

FreeXEnon wrote:I have never had to setup anything different on this or any of my ISP's, the default php mail has always worked until now.


Of course, as your ISP provides a fully featured webspace including a SMTP mailserver registered to your hosted domain.

FreeXEnon wrote:I do not want to add a username and password for a service. It should just send email through php.

Anyone have a clue?


PHP cannot just send emails, it requires an SMTP server as i already said.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: PHP Mail giving error on Win 10 - 64 bit

Postby FreeXEnon » 26. July 2017 17:06

Alrighty!
I got it setup, thanks!
FreeXEnon
 
Posts: 4
Joined: 07. July 2017 16:00
Location: Baraboo, WI
XAMPP version: 3.2.2
Operating System: Win 10 (64 bit)


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 96 guests