Uncaught Error: Call to undefined function fsockopen()

Error Message

Fatal error : Uncaught Error: Call to undefined function fsockopen() in /home/vol1_8/infinityfree.com/if0_35118896/forum.staup.online/htdocs/inc/mailhandlers/smtp.php:276 Stack trace: #0 /home/vol1_8/infinityfree.com/if0_35118896/forum.staup.online/htdocs/inc/mailhandlers/smtp.php(199): SmtpMail->connect() #1 /home/vol1_8/infinityfree.com/if0_35118896/forum.staup.online/htdocs/inc/functions.php(689): SmtpMail->send() #2 /home/vol1_8/infinityfree.com/if0_35118896/forum.staup.online/htdocs/member.php(3001): my_mail(‘sam****@hotmai…’, ‘Heda gardas’, ‘stasar,\n\n\n\nStau…’, ‘’, ‘’, ‘’, false, ‘text’, ‘’, ‘s****asar42@gma…’) #3 {main} thrown in /home/vol1_8/infinityfree.com/if0_35118896/forum.staup.online/htdocs/inc/mailhandlers/smtp.php on line 276

Other Information

I’m using Mybb and I get this error when I try to send an email via SMTP. Is there a problem with fsockopen() on the hosting side?

Hi STasaR,

Socket-related functions are disabled here afaik. Use API-based methods for email instead.

Cheers!

3 Likes

As part of the PHP 8.2 upgrade, the fsockopen function is disabled. This doesn’t prevent you from using SMTP though, PHPMailer and Symfony Mailer both use stream_socket_client for SMTP, which is very similar and does just work.

I don’t fully understand why fsockopen is blocked but stream_socket_client isn’t, so I’ll check with iFastNet what can be done about it.

6 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.