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.