jonty Posted December 29, 2008 Share Posted December 29, 2008 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? Link to comment https://forums.phpfreaks.com/topic/138709-most-basic-fsockopen-issue-is-syntax-wrong/ Share on other sites More sharing options...
DimitriDV Posted December 29, 2008 Share Posted December 29, 2008 It seems that it is a php bug in versions lower than 4.3, which version of php are you using? If that doesn't work, it might be that the server is not allowing outbound SMTP connections, likely though a firewall rule. Link to comment https://forums.phpfreaks.com/topic/138709-most-basic-fsockopen-issue-is-syntax-wrong/#findComment-725216 Share on other sites More sharing options...
jonty Posted December 29, 2008 Author Share Posted December 29, 2008 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. Link to comment https://forums.phpfreaks.com/topic/138709-most-basic-fsockopen-issue-is-syntax-wrong/#findComment-725261 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.