Jump to content

Most basic fsockopen issue - is syntax wrong?


jonty

Recommended Posts

Trying to get PHP to mail through a remote mail server (not belonging to my ISP).

 

$smtp = fsockopen("smtp.newsguy.com", 25);

 

but:

 

Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.newsguy.com:25 (Connection timed out)

 

I can manually telnet to smtp.newsguy.com fine. Outlook uses it for sending mail fine. No proxies.  PHP code above is running on shared hosting provider.

 

I have also tried other smtp servers like "smtp.gmail.com" - same problem.

 

Also tried PEAR Mail and PHP Mailer - same problem.

 

It's killing me - anything obviously wrong here?

 

 

 

 

 

 

PHP 5.2.5.

 

I think your second suggestion might be right thanks Dimitri - I just called the web hosting company after reading your message, they suggested they might be blocking outbound SMTP connections but they weren't entirely sure.

 

Which is quite annoying if true.

 

Thanks for the suggestion.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.