• Resolved walterb75

    (@walterb75)


    I have tried everything to get my office365 email to work on the site and exhaused everything to this point with office365 support. I also tried a gmail email and received the same error
    SMTP ERROR: Failed to connect to server: (0)SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    I went to the link above and have done all the trouble shooting recommended to no avail.

    Has anyone else had this problem with their Office365 email and did you find a fix.

    Versions:
    WordPress: 5.0.4
    WordPress MS: No
    PHP: 7.1.28
    WP Mail SMTP: 1.4.2

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

    Server:
    OpenSSL: OpenSSL 1.0.2r 26 Feb 2019
    SMTP Debug:
    2019-05-24 04:23:32 Connection: opening to ssl://smtp.office365.com:587, timeout=10, options=array (
    )
    2019-05-24 04:23:32 Connection: Failed to connect to server. Error number 2. “Error notice: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
    error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
    2019-05-24 04:23:32 Connection: Failed to connect to server. Error number 2. “Error notice: stream_socket_client(): Failed to enable crypto
    2019-05-24 04:23:32 Connection: Failed to connect to server. Error number 2. “Error notice: stream_socket_client(): unable to connect to ssl://smtp.office365.com:587 (Unknown error)
    2019-05-24 04:23:32 SMTP ERROR: Failed to connect to server: (0)
    2019-05-24 04:23:32 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • This can be the issue of your server presenting an invalid certificate, so it’s failing. You can either fix your certificate or do what it suggests in the troubleshooting guide, which is adding this code snippet. You should not do this unless you have to – it’s compromising your security.

    In case it helps, here’s a tutorial on where and how to add custom codes like that.

    I hope this helps!

    Hi @walterb75,

    We haven’t heard from you in about a week, so I’m going to go ahead and mark this ticket resolved. If you still have questions, though, please feel welcome to continue the conversation.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Smtp connection error’ is closed to new replies.