Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini

Question posted by: aa (Guest) on July 17th, 2005 09:28 AM
Warning: mail(): Failed to connect to mailserver at "localhost" port 25,
verify your "SMTP" and "smtp_port" setting in php.ini

in php.ini I have:

SMTP = localhost
SMTP_PORT = 25
SENDMAIL_FROM = NULL
SENDMAIL_PATH = "H:\WINNT\system32\" (this is where sendmail.dll is
sitting. H is the drive with w2k)

Other PHP code on that page is working.

What else should I check?


Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Alvaro G Vicario's Avatar
Alvaro G Vicario
Guest
n/a Posts
July 17th, 2005
09:28 AM
#2

Re: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
*** aa wrote/escribió (Mon, 8 Nov 2004 16:23:09 -0000):[color=blue]
> SMTP = localhost
> SMTP_PORT = 25
> SENDMAIL_FROM = NULL
> SENDMAIL_PATH = "H:\WINNT\system32\" (this is where sendmail.dll is
> sitting. H is the drive with w2k)[/color]

Unless it has been changed in recent versions, Windows builds do not accept
the sendmail_path parameter. Under Windows you cannot send mail through an
executable, you need to have a running mail server that accepts connections
through TCP ports.

Is your sendmail listening on port 25?


--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--

aa's Avatar
aa
Guest
n/a Posts
July 17th, 2005
09:28 AM
#3

Re: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
Under Windows you cannot send mail through an[color=blue]
> executable, you need to have a running mail server that accepts[/color]
connections[color=blue]
> through TCP ports.[/color]

Is there a suitable mailserver in w2k setup disk? If I have OE and Outlook
running, does this mean that I have a mail server (my whole question relates
to my local computer only, no ISP is involved)

[color=blue]
> Is your sendmail listening on port 25?[/color]

How do I check it?



Alvaro G Vicario's Avatar
Alvaro G Vicario
Guest
n/a Posts
July 17th, 2005
09:29 AM
#4

Re: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
*** aa wrote/escribió (Mon, 8 Nov 2004 18:04:20 -0000):[color=blue]
> Is there a suitable mailserver in w2k setup disk?[/color]

I believe you have IIS. However, it's normally easier to just type the
server your ISP provides.

[color=blue]
> If I have OE and Outlook running, does this mean that I have a mail
> server[/color]

Nope, that means you have a mail client.
[color=blue][color=green]
>> Is your sendmail listening on port 25?[/color]
>
> How do I check it?[/color]

There're many ways. For instance, you can type this in a command line:

telnet localhost 25

and see if someone replies.


--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--

aa's Avatar
aa
Guest
n/a Posts
July 17th, 2005
09:29 AM
#5

Re: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
Thanks, Alvaro.

1. > I believe you have IIS. However, it's normally easier to just type the
server your ISP provides.

Yes, IIS5 on w2k Pro
But what you mean by type the server your ISP provides? I am trying the
mail() to work on my local machine.

2. telnet localhost 25 returns "Connection to host lost"
What does this mean and what shall I do?



Alvaro G Vicario's Avatar
Alvaro G Vicario
Guest
n/a Posts
July 17th, 2005
09:29 AM
#6

Re: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
*** aa wrote/escribió (Tue, 9 Nov 2004 09:25:27 -0000):[color=blue]
> But what you mean by type the server your ISP provides? I am trying the
> mail() to work on my local machine.[/color]

How do you send your regular mail using Outlook Express? I suppose you've
configured an e-mail account and you've set your ISP's mail server for mail
delivery (something like smtp.virgin.net or whatever its name is). In PHP
is the same.

You don't need to install and configure your own mail server to send mail
from PHP... unless you're interested in learning to configure a MTA (mail
transport agent).

[color=blue]
> 2. telnet localhost 25 returns "Connection to host lost"
> What does this mean and what shall I do?[/color]

I guess you don't have a mail server listening in port 25. Which is
normally a good thing.


--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--

aa's Avatar
aa
Guest
n/a Posts
July 17th, 2005
09:29 AM
#7

Re: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
Thanks, Alvaro, this is exactly what I was missing about the whole thing



 
Not the answer you were looking for? Post your question . . .
183,630 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors