• Resolved Drew75

    (@drew75)


    Within the last couple of days, our email address is unable to receive emails through our website contact form. We are using WP Mail SMTP for email performance and when logged into our admin or go to Misc in the WP Mail SMTP setttings, I get the message below.

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

    Mailer: Gmail
    {
    “error”: “invalid_grant”,
    “error_description”: “Bad Request”
    }
    Consider running an email test after fixing it.

    Could this be related to the issue we are having and can you please assist with how to resolve it? Thank you!

    • This topic was modified 5 years ago by Drew75.

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

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter Drew75

    (@drew75)

    Additionally, I have authorized the plugin to send emails using our Google account.

    somboonthaifood

    (@somboonthaifood)

    I am getting a similar message using my host’s smtp settings…

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

    Mailer: Other SMTP
    PHPMailer was able to connect to SMTP server but failed while trying to send an email.
    Consider running an email test after fixing it.

    I do get the test emails fine. I get the message when I test my contact from using WP Forms Contact form.

    somboonthaifood

    (@somboonthaifood)

    I fixed mine by going into the settings for my contact form and changing the email address fields from {adminemail} to the email address used to authenticate the SMTP plugin and it worked.

    Hi @drew75 – Invalid grant error indicates the permission issue which appears when your secret key get invalidated. This could happen when the Gmail password is changed or when 2FA is enabled. To resolve this you’ll need to regenerate tokens by going to the console.developers.google.com > Credentials page. Click on the Edit screen for your credentials and Reset Secret after that. Here’s the button you need to click.

    @somboonthaifood – I’m glad your issue is now resolved. If you have any questions, please create a new post and don’t continue on this unrelated issue thread.

    Thanks!

    Thread Starter Drew75

    (@drew75)

    Thank you @sanzeeb3! Can I access this under any Google account or does it need to done while signed into a specific one? I get a You do not have sufficient permissions to view this page message when accessing it.

    • This reply was modified 5 years ago by Drew75.
    Jess Quig

    (@jquigam)

    Hi @drew75,

    Sorry for the late response here!

    For the steps Sanjeev shared (and all setup steps involved in the Google mailer setup) please be sure you’re logged into whichever email account you want to use as the From Email on your WordPress site.

    I hope this helps!

    Thread Starter Drew75

    (@drew75)

    Thank you @jquigam and no worries. It looks like no credentials have ever been created under the From Email and I had to do an initial free trial setup with Google APIs to access APIs & Services, so there is no Edit screen for credentials and a Reset Secret option as @sanzeeb3 alluded to.

    Do I need to create a new OAuth 2.0 Client ID for this or any API keys?

    Jess Quig

    (@jquigam)

    If you set up a new email account with the Gmail mailer, then you’d need to go through the full setup process again.

    Within WP Mail SMTP, you’ll need to add the Client ID and Client Secret generated during that setup process.

    The important thing to keep in mind is that all of this setup needs to be done under whichever email account you want to use as the From Email on your site — Google’s API (used in our mailer) is super particular about this.

    Hopefully this lets you finish up the setup!

    Thread Starter Drew75

    (@drew75)

    Hello @jquigam and sorry for my delayed response. I followed the steps you provided and everything looks to be working now. Thank you!

    Jess Quig

    (@jquigam)

    That’s great to hear, @drew75! Thanks for letting us know ??

    Thread Starter Drew75

    (@drew75)

    It looks like I’m having another issue with WP Mail SMTP.

    Mailer: Gmail
    {
    “error”: “invalid_grant”,
    “error_description”: “Bad Request”
    }

    Do I need to run the full setup process again? What is causing this issue?

    Hi @drew75,

    Is there any chance you’ve changed your Google account password or enabled two-factor authentication? The error message indicates that your secret key is invalidated. Please reset your key and reauthorize your account to send emails or alternatively, follow the process in the documentation again.

    I hope this helps!

    Thread Starter Drew75

    (@drew75)

    Thank you. I have initiated a authorization with the email and after going through the steps, I’m getting this error message in the app settings.

    I removed the connection and tried again, yet I still get the same result.

    Mailer: Gmail
    {
    “error”: “invalid_grant”,
    “error_description”: “Bad Request”
    }
    Please re-grant Google app permissions!
    Go to WP Mail SMTP plugin settings page. Click the “Remove Connection” button.
    Then click the “Allow plugin to send emails using your Google account” button and re-enable access.

    Consider running an email test after fixing it.

    Thread Starter Drew75

    (@drew75)

    Nevermind, it looks like all is working now. That error message was from my previous attempt. Thank you!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Email delivery error’ is closed to new replies.