XF 2.2 Office 365 does not work with XenForo

You should be able to trigger the issue with this bit of PHP:

Code:
<?php

ini_set('display_errors', true);

$host = 'tcp://smtp.office365.com:587';

$result = stream_socket_client($host, $errno, $errstr, 5);
if (!$result)
{
   echo "Error connecting to $host: $errstr (error: $errno)";
}
else
{
   echo "Connected to $host successfully";
   fclose($result);
}

I'd recommend running that from a script within your XF root directory and accessing it via the web, as that will replicate the situation where XF is sending mail itself. Assuming you have problems there, then you may want to take steps to try to replicate it via the command line if possible, though there are firewall/security settings that you might not fully replicate via the command line.
 
Will this make the site unavailable or leak server information to the public?
It won't affect the rest of your site.

I would name the file something like smtptest.php and then you can remove it once you're done testing or the issue is resolved. It may display an error message which might include a file path, but that's it. Given that the file would only be present when testing and is an unknown file name, there's no reason for anyone else to request it.

Can you get an Office 365 account and try?

This problem has been on XenForo for a long time: https://xenforo.com/community/threads/smtp-connection-refused.119144/
I've used the test script and it connects with no issue.

Many hosts block outgoing SMTP connections for anti-spam reasons. The host referenced in that thread is well known for this.

The error message you're receiving is not coming from XenForo. It's actually not even coming from PHP itself. It's coming from the network stack within the operating system. There aren't any changes that we can make that would bypass server security, network or firewall settings.
 
It won't affect the rest of your site.

I would name the file something like smtptest.php and then you can remove it once you're done testing or the issue is resolved. It may display an error message which might include a file path, but that's it. Given that the file would only be present when testing and is an unknown file name, there's no reason for anyone else to request it.


I've used the test script and it connects with no issue.

Many hosts block outgoing SMTP connections for anti-spam reasons. The host referenced in that thread is well known for this.

The error message you're receiving is not coming from XenForo. It's actually not even coming from PHP itself. It's coming from the network stack within the operating system. There aren't any changes that we can make that would bypass server security, network or firewall settings.
I've talked with my host three times, they say SMTP is enabled every time. And as I said, the python script works but not XenForo.
I'll try the test script you sent me.
 
Back
Top Bottom