the web server and smtp server are both iis6
Main Topics
Browse All TopicsHi All,
This one is driving me mad.
I have installed php 5 on both our web server and my home stand alone computer and have set up a page with a form, from which to send an email.
both installations are identical, php.ini, both running IIS etc, from me home machine the mail sends no problem, the web server at work produces the following error,
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
I have searched and tried most solutions to no avail. I have changed the smtp in the php.ini to various mail servers, pointed it to our internal mail server, our isp,s server etc, still no joy.
As a further note, the webserver does have smtp instaled and enabled and is currently running an asp site and using CDOmail no problem (not sure if this is relevant)
I do have a sonicwall firewall and the webserver is connected to the DMZ (opt) port, I have opened port 25 to the mail server and the outside world
Any more info required, please ask,
Many thanks
Keith
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I would use PHPMailer's SMTP engine - all you need to do is go to http://phpmailer.sourcefor
Also, go to a command prompt on the machine that isn't sending mail and type this:
telnet localhost 25
then you will get a blank screen, you re talking in SMTP to your mail server, now type these commands to send yourself an email:
HELO something.com
MAIL FROM: <test@test.com>
RCPT TO: <youremail@yourdomain.com>
DATA
Subject: Test Email
This is a test
.
QUIT
Ok - now it should have said "Message Accepted for Delivery" or something like that. If you were unable to even connect to port 25 there is different issue.
I have sloved the problem and split the points as both pointed me in the right direction.
The solution, We are running McAfee AV and in its default installation is sets up a port blocking rule to block port 25. To override this i have edited the exceptions to inclule php-cgi.exe and php.exe
Many thanks for your help
Keith
I get about the same message: Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.att.yahoo.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini.
I am running both IIS and Apache 2.2, one on port 80 and one on port 8080. I get this message when I execute on http://localhost:8080/repo
Thanks for any help
Business Accounts
Answer for Membership
by: LhotchPosted on 2006-02-10 at 06:18:35ID: 15922671
The mail() function is designed to work with sendmail, if your using a different mail server you have to make sure your using the mail wrappers for the server you intend to use.