Mail forms

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

Mail forms

Postby kkillgasmm » 12. January 2007 16:09

I'm using 'Sams teach yourself php mysql and apache in 24 hours' to learn php and have tried the sample code it has to code a feedback form but i received the following message at the bottom of the resutls page when trying to test it out...

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:\Program Files\xampp\htdocs\xampp\Mystuff\new\listing9.12.php on line 21

i checked my emails and nothing arrived!

any help?
i would have thought it would have worked becuase im sure the book talks about php5!
Posts: 9
Joined: 06. January 2007 17:32
Location: Liverpool, UK

First attempt at a reply-hope it to be helpful

Postby bronxtechno » 23. January 2007 16:07

Before doing anything else, please confirm that you can telnet to your smtp server on port 25 with no problems. An example of this from either commandline windows or linux is

telnet 25

What you should see in response is something that looks like:


If you do not see this, you need to troubleshoot outside of the application first. Look to see if you have a personal firewall that may be blocking you. Check to see if your isp is blocking port 25 access. Find out from your mail server host if there are alternative ports that can be used to test or use.

Hope that helps.

Roy Lopez

aka BronxTechno
Posts: 2
Joined: 23. January 2007 15:51

Postby cvdbAdmin » 23. January 2007 22:17

The other thing that you might check is whether or not you have an email server on your system. I may be wrong about this but I don't think Xampp automatically comes with one. If you don't have one then there isn't anything listening to that port and you won't be able to send or receive anything.
Posts: 17
Joined: 19. January 2007 22:19

Postby bronxtechno » 24. January 2007 17:20

Good thought, speaking directly to the fact that the error he is seeing is saying failure to connect to mailserver localhost at port 25. That is the default in the php.ini, if smtp was manually enabled (by default sendmail is enable which according to other posts has been reported not to work on windows).

Now comes the confusing part, which php.ini should you fix because by default you may actually have three of them:

c:\program files\xampp\apache\bin\php.ini
c:\program files\xampp\php\php.ini

It has been said that one by who is more learned than me, that the one that you seek can be found by interrogating the apache httpd.conf file, but that is for you to determine for yourself. I have look but found nothing of help there.

What I have found best to work for me is to edit the one in the apache\bin directory. With that I take my leave of you, wishing a fair wind on your voyage to resolution...
Posts: 2
Joined: 23. January 2007 15:51

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 58 guests