• Resolved adamo43

    (@adamo43)


    Hello
    I have a problem with sending e-mails from wpmail via the outlook365.com server thru other SMTP option.
    Connection failed. Error # 2: stream_socket_client (): unable to connect to smtp.office365.com:587 (Network is unreachable)

    full log

    Versions:
    WordPress: 5.7.5
    WordPress MS: No
    PHP: 7.4.20
    WP Mail SMTP: 2.9.0

    Params:
    Mailer: smtp
    Constants: No
    ErrorInfo: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
    Host: smtp.office365.com
    Port: 587
    SMTPSecure: tls
    SMTPAutoTLS: bool(true)
    SMTPAuth: bool(true)

    Server:
    OpenSSL: OpenSSL 1.0.2k 26 Jan 2017

    Debug:
    Mailer: Other SMTP
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    SMTP Debug:

    2022-01-24 23:31:15 Connection: opening to smtp.office365.com:587, timeout=300, options=array()

    2022-01-24 23:31:18 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.office365.com:587 (Network is unreachable) [/SZKOLENIA/wp-includes/PHPMailer/SMTP.php line 388]

    2022-01-24 23:31:18 SMTP ERROR: Failed to connect to server: Network is unreachable (101)

    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    The hosting provider claims that there is a blockage on the outlook side
    I personally check through mxtoolbox.com and it works – there is no blockade
    I can also connect to an e-mail client from any network

    Does wp mail have any lock on other smtp which is Server name: SMTP service settings
    Server name: smtp.office365.com
    Port: 587
    Encryption method: STARTTLS

    which TLS version of wp mail does it use?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support Darshana

    (@darshanaw)

    Hi @adamo43,

    Thanks for reaching out! If you have enabled Multi-Factor Authentication (2 Factor Authentication) on your Office 365 email account, you need to set up an App Password within your Office 365 account settings and then you can use that App Password under your WP Mail SMTP -> Settings -> SMTP password area.

    In case it helps, try following our guide here as well.

    Could you please give it a try and let us know how it goes. Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Connection failed. Error #2: stream_socket_client(): unable to connect to smtp’ is closed to new replies.