• Resolved esmabama

    (@esmabama)


    Hi there!

    I have tried to send a test email with the plugin: WP MAIL SMTP, but no success.
    Error log:

    Versions:
    WordPress: 6.1.1
    WordPress MS: No
    PHP: 7.4.33
    WP Mail SMTP: 3.7.0 Params:
    Mailer: smtp
    Constants: No
    ErrorInfo: SMTP Error: Could not connect to SMTP host. Failed to connect to serverSMTP server error: Failed to connect to server SMTP code: 101 Additional SMTP info: Network is unreachable
    Host: smtp-legacy.office365.com
    Port: 587
    SMTPSecure: tls
    SMTPAutoTLS: bool(true)
    SMTPAuth: bool(true) Server:
    OpenSSL: OpenSSL 1.1.1p 21 Jun 2022
    Apache.mod_security: No Debug:
    Email Source: WP Core
    Mailer: Other SMTP
    SMTP Error: Could not connect to SMTP host. Failed to connect to serverSMTP server error: Failed to connect to server SMTP code: 101 Additional SMTP info: Network is unreachable
    Email Source: PRO Elements
    Mailer: Other SMTP
    SMTP Error: Could not connect to SMTP host. Failed to connect to serverSMTP server error: Failed to connect to server SMTP code: 101 Additional SMTP info: Network is unreachable
    Email Source: WP Mail SMTP
    Mailer: Other SMTP
    SMTP Error: Could not connect to SMTP host. Failed to connect to serverSMTP server error: Failed to connect to server SMTP code: 101 Additional SMTP info: Network is unreachable SMTP Debug:
    2023-03-14 10:37:02 Connection: opening to smtp-legacy.office365.com:587, timeout=300, options=array() 2023-03-14 10:37:11 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp-legacy.office365.com:587 (Network is unreachable) [/home/esmabam1/public_html/wp-includes/PHPMailer/SMTP.php line 389] 2023-03-14 10:37:11 SMTP ERROR: Failed to connect to server: Network is unreachable (101) SMTP Error: Could not connect to SMTP host. Failed to connect to server

    On the page with the contact form, when I try to send it, it displays the error:
    Server error. Form not sent.
    An error occurred.

    Can you help?

    Thank you

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Dake

    (@dakeg)

    Hi @esmabama

    Thanks for reaching out and we’re sorry to hear that you are experiencing issues with the Other SMTP mailer.

    Could not connect to SMTP host

    Based on the error message you received, the issue is server-related.

    The ideal next step is to contact your SMTP/hosting provider with that error report to fix the server configuration or to see if anything is blocking it. They’d hopefully be able to help!

    I’m sorry, but we can’t directly assist with this issue on our side since it’s SMTP/hosting-related.

    Also please note, that the Other SMTP mailer option does not use a dedicated API, which can lead to potential errors based on your website hosting settings. In cases where ongoing issues arise while using the Other SMTP mailer, we generally recommend switching to a transactional mailer option (it’s all mailers except the Other SMTP and Default (none) option).

    As a test or full-on alternative, you can try setting up one of our other available mailers by following the instructions outlined in our documentation.

    I hope this helps!

    Thread Starter esmabama

    (@esmabama)

    Dear Drake,

    I appreciate your reply. I have been in touch with the SMTP/ hosting provider for a while.

    We did a test script to verify id the SMTP Auth was working:

    # Get the credential

    $credential = Get-Credential

    ## Define the Send-MailMessage parameters

    $mailParams = @{

        SmtpServer                 = ‘smtp.office365.com’

        Port                       = ‘587’ # or ’25’ if not using TLS

        UseSSL                     = $true ## or not if using non-TLS

        Credential                 = $credential

        From                       = ‘affectedaccount@domain.com’

        To                         = ‘affectedaccount@domain.com’‘ExternalRecipientInCC@domain.com’

        Subject                    = “SMTP Client Submission – $(Get-Date -Format g)”

        Body                       = ‘This is a test email using SMTP Client Submission’

        DeliveryNotificationOption = ‘OnFailure’, ‘OnSuccess’

    }

    ## Send the message

    Send-MailMessage @mailParams

    All emails were sent with no issue. So we conclude the problem is on the plugin side.

    We are a NGO, with no budget for the PRO version, in order to use the mailer “365/ Outlook” (it is Microsoft providing our email server), we have been using “Other SMTP”.

    Do have a suggestion on how to solve this situation?

    Thank you for your time in advance.

    Plugin Support Dake

    (@dakeg)

    Hi @esmabama

    Thank you for getting back to us.

    At this stage, we can only assume that there may be a conflict or firewall preventing the connection from being established via your website.

    As a test you can try disabling your other plugins and switching to a default theme. It may also help to try using the same connection with different SMTP plugins to see if this really is a server-side/plugin specific issue.

    We would also like to point out that you are able to use other mailers even if your email provider is Outlook/hotmail etc. WP Mail SMTP determines the From Email, but it doesn’t restrict it to a particular email provider or even a live mailbox if using a transactional mailer like Sendinblue for example.

    I hope this helps.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WP MAIL SMTP – error in sending test email and sending contact form’ is closed to new replies.