• Resolved franciscodmaia

    (@franciscodmaia)


    Hi,

    I know there are a few topics about this issue already, but nothing seems to work for me.

    Lately, this message pops up on my backoffice:

    EMAIL DELIVERY ERROR: the plugin WP Mail SMTP v2.0.0 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.

    I am a rookie on WordPress and I really need help on it because I want to share my website on some social media platforms this week.

    Thanks for any help, in advance!

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

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi @franciscodmaia,

    The ‘Invalid Grant’ means an issue with the permission to the Google APP you’ve created. Maybe you’ve changed your Gmail password or enabled 2-step verification. In this case, you’ll need to reset your client secret key. Alternatively, you could follow the documentation to re-do all the steps.

    I hope this helps!

    Thread Starter franciscodmaia

    (@franciscodmaia)

    I actually tried that yesterday and this message appears on the ”Authorization” area:

    ”Uncaught Error: Call to undefined function Symfony\Polyfill\Intl\Idn\mb_strtolower() in /home/franciscomaia/public_html/wp-content/plugins/wp-mail-smtp/vendor/symfony/polyfill-intl-idn/Idn.php on line 71
    idn_to_ascii()
    wp-content/plugins/wp-mail-smtp/vendor/symfony/polyfill-intl-idn/bootstrap.php:55
    idn_to_ascii()
    wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Utils.php:36
    idnUriConvert()
    wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Client.php:220
    buildUri()
    wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Client.php:113
    sendAsync()
    wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Client.php:130
    send()
    wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php:34
    __invoke()
    wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/OAuth2.php:502
    fetchAuthToken()
    wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Client.php:282
    fetchAccessTokenWithRefreshToken()
    wp-content/plugins/wp-mail-smtp/src/Providers/Gmail/Auth.php:132
    get_client()
    wp-content/plugins/wp-mail-smtp/src/Providers/Gmail/Auth.php:37
    __construct()
    wp-content/plugins/wp-mail-smtp/src/Providers/Gmail/Options.php:151
    display_auth_setting_action()
    wp-content/plugins/wp-mail-smtp/src/Providers/Gmail/Options.php:134
    display_options()
    wp-content/plugins/wp-mail-smtp/src/Admin/Pages/SettingsTab.php:288
    display()
    wp-content/plugins/wp-mail-smtp/src/Admin/Area.php:552
    display_current_tab_content()
    wp-content/plugins/wp-mail-smtp/src/Admin/Area.php:533
    display_tabs()
    wp-content/plugins/wp-mail-smtp/src/Admin/Area.php:465
    display()
    wp-includes/class-wp-hook.php:287
    apply_filters()
    wp-includes/class-wp-hook.php:311
    do_action()
    wp-includes/plugin.php:478
    do_action()
    wp-admin/admin.php:254
    There has been a critical error on your website. Please check your site admin email inbox for instructions.

    Learn more about debugging in WordPress.”

    Should I delete the plugin and try again?

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @franciscodmaia,

    we can’t reproduce the error you are experiencing, but we might have a solution for it.

    Could you please follow these steps:

    1. FTP to your server and locate your WP site folder
    2. open the file .../wp-content/plugins/wp-mail-smtp/vendor/symfony/polyfill-mbstring/bootstrap.php
    3. copy the code from this site and overwrite all content in the bootstrap.php that you opened in the 2.step

    If you don’t know how to do that or if you don’t feel comfortable doing that, please contact your web hosting support and ask them to do this for you.

    Please let us know if this resolves the PHP error.

    Have a nice day!

    Thread Starter franciscodmaia

    (@franciscodmaia)

    Hi,

    I was actually not very confortable with doing it but I tried anyway and I think I got everything right…however it did not work!

    What should I do?

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    after doing the above steps, you still get this error?

    Uncaught Error: Call to undefined function Symfony\Polyfill\Intl\Idn\mb_strtolower()

    If you FTP to your server again and check the content of the file .../wp-content/plugins/wp-mail-smtp/vendor/symfony/polyfill-mbstring/bootstrap.php, is the content the same as this page?

    I just want to be sure, since the fix should define the missing PHP function…

    Take care!

    Thread Starter franciscodmaia

    (@franciscodmaia)

    I wish I could send you a pic showing, but yes, it is! I actually changed it back to the original code last time because I didn’t see any differences, but now I put the content of that page on the file and nothing changed again..

    There’s still the message saying:

    Uncaught Error: Call to undefined function Symfony\Polyfill\Intl\Idn\mb_strtolower() in /home/franciscomaia/public_html/wp-content/plugins/wp-mail-smtp/vendor/symfony/polyfill-intl-idn/Idn.php on line 71

    .
    .
    .

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    thank you for verifying this for me.

    Could you please tell me which web hosting company you are using (which plan/package you are on), which PHP version is your WP site running on and which WP plugins you are using?

    Are you maybe using some sort of caching, like opcache, that would prevent the PHP file update to actually take effect?

    I would like to replicate this issue on my local development environment, so I can debug and fix it.

    Thank you!

    Thread Starter franciscodmaia

    (@franciscodmaia)

    Hi,

    So my hosting company is WebHS, a portuguese company that I’ve been working with. It’s a very simple plan, paying like 6,5€/month. Simpler one I think.
    My Running PHP version: 7.3.17
    I have the following plugins:
    Allin1SEOPack
    Astra Widgets
    Classic Editor
    Display PHP Version
    Elementor
    Google Tag Manager for WordPress
    Hotjar
    Insert Footers and Headers
    No Category Base (WPML)
    Official Facebook Pixel
    Query Monitor
    Really Simple SSL
    Redirection
    Starter Templates
    Ultimate Addons for Gutenberg
    WP Mail SMTP
    WPForms Lite

    ”Are you maybe using some sort of caching, like opcache, that would prevent the PHP file update to actually take effect?” – I am not sure how to see this but I searched on my site files on ”Cache” and there’s no files or folders.\

    Thank you soo much for all the attention displayed, taking that in count man!

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    I’ve looked at the plugins you are using, looking for a “conflict”…

    And I think I found it. You see, WPForms is also using the “symfony/polyfill-mbstring” package. Theirs is executing before the WP Mail SMTP does and so the WP Mail SMTP one (the one you changed) did not even execute πŸ™‚

    Could you please do the steps in the message above again and make the change for WP Mail SMTP and then also do the same for the WPForms, but you have to use this code for WPForms (it’s a minor change to the file in previous messages), for this file on your server: .../wp-content/plugins/wpforms-lite/vendor/symfony/polyfill-mbstring/bootstrap.php.

    Let me know if this will resolve your issue.

    Have a nice day!

    Thread Starter franciscodmaia

    (@franciscodmaia)

    It worked! Feeling like a programmer honestly Hahah You the man!! Thanks a lot. If there’s any quest for feedback or something send it. I’ll give you a 5 star rating. amazing. Thanks!!

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    Yey! Look at you, a proper programmer fixing PHP issues like it’s nothing! πŸ™‚

    I’m glad this is fixed now. I hope the 3rd party library symfony/polyfill-mbstrings will release an update with these changes and we can include that in the next plugin update.

    You can rate the plugin here: https://wordpress.org/support/plugin/wp-mail-smtp/reviews/

    Thank you and have a nice day!

    PHP Fatal error: Uncaught Error: Call to undefined function Symfony\\Polyfill\\Intl\\Idn\\mb_strtolower() in /var/www/wordpress/vervantis/wp-content/plugins/wp-mail-smtp/vendor/symfony/polyfill-intl-idn/Idn.php:71\nStack trace:\n#0 /var/www/wordpress/vervantis/wp-content/plugins/wp-mail-smtp/vendor/symfony/polyfill-intl-idn/bootstrap.php(55): Symfony\\Polyfill\\Intl\\Idn\\Idn::idn_to_ascii(‘oauth2.googleap…’, 0, 1, NULL)\n#1 /var/www/wordpress/vervantis/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Utils.php(36): idn_to_ascii(‘oauth2.googleap…’, 0, 1, NULL)\n#2 /var/www/wordpress/vervantis/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Client.php(220): GuzzleHttp\\Utils::idnUriConvert(Object(GuzzleHttp\\Psr7\\Uri), 0)\n#3 /var/www/wordpress/vervantis/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Client.php(113): GuzzleHttp\\Client->buildUri(Object(GuzzleHttp\\Psr7\\Uri), Array)\n#4 /var/www/wordpress/vervantis/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Client.php(130): GuzzleHttp\\ in /var/www/wordpress/vervantis/wp-content/plugins/wp-mail-smtp/vendor/symfony/polyfill-intl-idn/Idn.php on line 71

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @ghanshyamwnw

    it is the same error, so you can do the above steps to fix it, or downgrade the WP Mail SMTP plugin to version 1.9.0.

    This will be fixed in one of the upcoming releases.

    Take care!

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @franciscodmaia and @ghanshyamwnw,

    we just released an update to our plugin (v2.0.1) and this PHP error issue should be fixed.

    Please update to the latest version and let us know if something is not working for you.

    Have a nice day!

    ghanshyamwnw

    (@ghanshyamwnw)

    ok thank you

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

The topic ‘EMAIL DELIVERY ERROR’ is closed to new replies.