Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi, I have a web form I am trying to test. It just gets values from fields and emails them. I get this error:
Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
Is there something wrong with this configuration in my php.ini? Thank you.
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25; For Win32 only.
;sendmail_from = me@example.com

Dear ShaqDiesel;
Try to Config your localserver as SMTP SERVER.
then look-for a real SMTP Provider (don't use HOTMAIL)
Also you have to be connected to internet to do that
Allam Rahmeh
Latakia Syria
it8.biz

SMTP = localhost equates to SMTP = 127.0.0.1 which means you are sending mail to yourself. Unless you have a mail server running on your computer it doesn't go anywhere.
You should also bear in mind that although most SMTP server use port 25 it is not universal. Some SMTP servers use a different port as an anti-spam measure. You should check with the SMTP provider as to what port they are using.
Stuart

sorry, but I'm kind of confused. So is there a way to configure my settings so this will work or do I have to install a mail server(I have apache, would that work?).
This form should read in values from visitors to my site and email them to me.
SMTP=localhost sends it to myself, but I don't have a mail server installed so does that mean I should do SMTP=<my email address>
I'm hoping to get this to work before my website goes live and I appreciate you guys' help.

You need a mail server of some kind to send Email. You can install a mail server but not Apache, thats a web server or you can use another mail server that you have an account with.
You need something like SMTP=smtp.yahoo.com
You send the Email to Yahoo who then sends it to your Email client like Outlook Express. You cannot send mail directly to Outlook Express, it has to come from a mail server. The sendmail function expects a mail server and nothing else will do.
That's assuming you have an Email account with Yahoo. You will also need a Username and password unless you use an open server and there are not many of them around these days as that is what spammers use.
Mine says smtp=smtpauth.dsl.pipex.com but that would be no use to you unless you have an account with Pipex as I do.
Stuart

Hey guys,
All he needs is the smtp server address that his ISP provides. I just made a contact page for my website last night using this same method. I'm on comcast so mine is smtp.comcast.net, it's really that simple. No additional software or anything like that.

Did you change anything else in php.ini? I corrected my smtp_server value but I get this error:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini

It is still looking for an SMTP server on the local computer and there isn't one.
What SMTP value are you using now?
Be aware that nor all ISPs provide an email service, but if they do, that is the one to use.
SMPT server addresses invariably start with SMTP. It means Simple Mail transfer Protocol. If you have anything else it isn't going to work
The same way that web addresses start with HTTP which means Hyper Text Transfer Protocol.
Stuart

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |