By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,374 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,374 IT Pros & Developers. It's quick & easy.

SMTP mail problem (but works OK in Outlook)

P: n/a


I'm finding when a mail is sent from a script, I get:

Warning: mail() [function.mail]: Failed to connect to mailserver at
"smtp.ntlworld.com" port 25, verify your "SMTP" and "smtp_port" setting in
php.ini or use ini_set() in C:\Documents and Settings\
However, when using Outlook and setting the SMTP agent in that to
smtp.ntlworld.com, on the same PC, mail is sent fine (using Outlook)
without any problems.

Can anyone think what might be the problem here?
Martin
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Martin Lucas-Smith wrote:

I'm finding when a mail is sent from a script, I get:

Warning: mail() [function.mail]: Failed to connect to mailserver at
"smtp.ntlworld.com" port 25, verify your "SMTP" and "smtp_port" setting in
php.ini or use ini_set() in C:\Documents and Settings\
However, when using Outlook and setting the SMTP agent in that to
smtp.ntlworld.com, on the same PC, mail is sent fine (using Outlook)
without any problems.

Can anyone think what might be the problem here?


First - I'm currently seeing varying types of weirdness from
smtp.ntlworld.com (which amongst other things tries to be clever about
blocking relaying (i.e. not just simply using the mechanisms built into the
MTA) and limiting virus outbreaks) so it may not be your code / config. NTL
are aware of issues and are currently advising customers to use their
webmail service (!).

Having said that, it's most likely your fault ;) !

Check your firewall - because of the architecture of the IP stack in
MSWindows, most firewall programs have visibility of the application
attempting to connect and can implement a policy accordingly.

If that's not the problem, it's worth checking that PHP is able to resolve
the name correctly. Also try connecting using fsockopen instead.

HTH

C.
Jul 17 '05 #2

P: n/a

Did you change your php.ini file? Your Outlook session is perhaps
correctly configured to 'know' that the SMTP server is smtp.ntlworld.com
however chances are, unless you've changed it, php.ini will use
localhost as its SMTP. Read: http://ca.php.net/manual/en/ref.mail.php

Hope that helps...
Randell D.

Martin Lucas-Smith wrote:

I'm finding when a mail is sent from a script, I get:

Warning: mail() [function.mail]: Failed to connect to mailserver at
"smtp.ntlworld.com" port 25, verify your "SMTP" and "smtp_port" setting in
php.ini or use ini_set() in C:\Documents and Settings\
However, when using Outlook and setting the SMTP agent in that to
smtp.ntlworld.com, on the same PC, mail is sent fine (using Outlook)
without any problems.

Can anyone think what might be the problem here?
Martin

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.