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!