• Resolved beauw

    (@beauw)


    Hello!

    I have WP Forms Lite (which works perfectly) and installed a staging copy of my website to do some heavy work on it.

    Since I had trouble sending email notifications (I use GMail), I was suggested to install WP Mail SMTP.
    It works really fine on my live site, but I cannot activate it on my staging site (error 400).

    Question(s): should my Client ID & Client Secret be the same as my live site?

    I tried to create a new API/OATH project with the staging URL, but it doesn’t work when I try to confirm with Google… Error 400.

    Does somebody have any clue as to what I should do?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @beauw,

    Please share the details of the 400 error. Your client & client secret could be the same depending, probably you’ve not added your staging site redirect URL in your Google app and you’ll need to reauthorize your Google account to send emails from your staging site.

    Thanks!

    Thread Starter beauw

    (@beauw)

    Hello Sanjeev!

    Thanks for your help 🙂

    I tried again to create an API & Oath 2 for my staging site, entering only the staging site url, but I get the same error 400:

    400. That’s an error.

    Error: redirect_uri_mismatch

    The redirect URI in the request, https://mysite.com/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/300363727370-iefmer8ksv3nghgi3v4i86ab965do9bv.apps.googleusercontent.com?project=300363727370

    I added the Authorized redirect URI from WP Mail SMTP, but still no luck…

    Do you have an idea on how to solve this? Maybe in .php?

    Thank you for any help you can provide!

    Thread Starter beauw

    (@beauw)

    I don’t know if this can help, but I also got this message from WP Mail SMTP:

    EMAIL DELIVERY ERROR: the plugin WP Mail SMTP v1.9.0 logged this error during the last time it tried to send an email:

    Mailer: Gmail
    {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    I’m at a loss regarding what to do next…

    Thank you in advance for any suggestion you can give me!

    Hi @beauw,

    Please double-check the ‘Authorized redirect URI’. The error message indicates that you’ve not registered ‘Authorized redirect URI’ (where the response is returned to) or registered incorrectly in the APIs console. Alternatively, follow all the steps in the tutorial again.

    Thanks!

    Thread Starter beauw

    (@beauw)

    Thank you for your help, Sanjeev!

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

The topic ‘Problem when installing on a staging site’ is closed to new replies.