• Resolved grimecho

    (@grimecho)


    I followed the directions for setting up SMTP mail sending via Google’s Gmail. I successfully created the Google API project, entered the correct information, and received a client ID and client secret. I pasted both of these into the WP Mail SMTP fields.

    The only portion of setup that differed from what the guide said, was that when I pressed “Allow Plugin to send emails using your Google account” I was directed to a “This app isn’t verified. This app hasn’t been verified by Google yet. Only proceed if you know and trust the developer. ” warning. I selected Advanced –> “Go to echogy.net” and continued. Google successfully asked me for permission to allow echogy.net to send mail on my behalf. I pressed allow and was returned to the settings page for the plugin.

    However, when trying to send a test email, I received the following:

    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 7.0.22-0ubuntu0.16.04.1
    WP Mail SMTP: 1.2.1
    
    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: No
    
    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes
    Apache.mod_security: No
    
    Debug:
    Error while sending via Gmail mailer: {
    "error": {
    "errors": [
    {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
    }
    ],
    "code": 401,
    "message": "Login Required"
    }
    }
    

    I repeated the procedure using a different Gmail account and has the exact same results.

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

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Slava Abakumov

    (@slaffik)

    After you confirmed to the Google, that you allow sending emails on your behalf, you should be redirected back to plugin admin area.

    At this moment your site didn’t generate Access Token. You have Auth Code, provided by Google. Just reload the plugin page in admin area – the access token should be generated. You can do that also by sending Email Test one or several times.

    I understand, that you wrote that you’ve already done that, but please do that again.

    I, too, am having this problem, exactly as @grimecho, down to the warning and error message even though the API appears in the Gmail Search Console as having been verified 4 times.

    I have reloaded the page in the admin area as @slaffik suggested several times. I have also deleted the plug-in and reinstalled it.

    Once I did all that, there is a change in the error message. Now it isn’t recognizing the Auth Code or Access Token and still, when hitting the confirm, I get the warning and have to go through the “unsafe” allow on Google. Then, it redirects back to the plugin which indicates all is well until I try to send a test email.

    Current error:
    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 5.6.32
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    Any other ideas?

    • This reply was modified 6 years, 10 months ago by esarbege. Reason: Additional info

    I am having the exact same issue. I have recreated Client ID and Client secret twice and no luck. Still getting error messages:

    There was a problem while sending a test email. Related debugging output is shown below:

    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 5.6.31
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    • This reply was modified 6 years, 10 months ago by reggie21.

    I have been diligently working on this problem over the past couple of days and have learned some very important things:

    First: Research now shows a two-pronged problem. My webhost is GoDaddy and GoDaddy blocks all outbound SMTP ports. Any plugin attempting to use any SMTP port will not work. I verified that directly with GoDaddy during a very long and intense tech help session today. So the WP Mail SMTP plug-in will never work on any GoDaddy website.

    Second: My extensive testing over the past couple of days to various domains indicated that my ISP is blocking all email from my webserver and in fact, from the GoDaddy range of IP addresses. The techs at GoDaddy traced the test emails from a different plug-in and confirmed that all emails from my site to my ISP were being blocked. So, the only recourse for me is to either:

    • Convince the blocking ISP to put an exception to the blocking for my server IP and/or email address or
    • Put a note on my site that anyone with an email address from that ISP will be unable to register for an account on the site. Please create a free account with Gmail, Hotmail or Yahoo first, then register for an account on the website.

    Hope this info helps someone else.

    why is this being marked as resolved?

    Thread Starter grimecho

    (@grimecho)

    I was the original poster and the issue was never resolved for me. I tried the suggested steps, but there was no change.

    I ran the exact setup procedure multiple times and even tried it on a fresh WordPress install with no other plugins. I was never able to get passed the “Login Required” error. I ended up giving up and instead used a plan SMTP account to send out mail.

    Plugin Author Slava Abakumov

    (@slaffik)

    @grimecho

    I pressed allow and was returned to the settings page for the plugin.

    I see that Auth Code is saved. So the issue is in getting Access Token.
    You have used some Gmail email account to generate Client ID/Secret – is that the same as in your FROM email address field in plugin General settings? If not – try use the same email address (from Client ID/Secret).
    Make sure you do NOT have “Allow…” button at the bottom of the page. IF you have – go through the “accepting” process again.

    the above worked, thank you @slaffik! It’s prompting a “Failed to send your message.” but I believe that may due to how I setup our contact form .. lmk if you have any insights to this as well, thanks again for your help .. this helped solve a very frustrating back-and-forth between to email/hosting vendors

    Plugin Author Slava Abakumov

    (@slaffik)

    @grimecho

    Your issue might be fixed in 1.2.4. Please update and try to setup Gmail again.
    We previously wiped tokens needed to work on settings save, that it is fixed in 1.2.4.

    Using 1.2.5 version of plugin, still getting the same issue, test mail displays the same error as stated above

    Also, when i authorise, it says you have successfully authorized the plugin to send email but when i send test email i get this error
    Any suggestions, need it on urgent basis

    Same Here:

    Using 1.2.5 version of plugin, still getting the same issue.

    Still broken, why havent you guys fixed this yet?

    There was a problem while sending a test email. Related debugging output is shown below:

    Versions:
    WordPress: 4.9.4
    WordPress MS: No
    PHP: 5.6.31
    WP Mail SMTP: 1.2.5

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes
    Apache.mod_security: No

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    solution

    I have tried this plugin and many others, and they all fail when making the smtp connection to gmail or outlook

    As of PHP 5.6 you will get a warning/error if the SSL certificate on the server is not properly configured.

    Gmail and Outlook use self signed certs so when php checks against the local certificate authority bundle, the connection will fail

    so in this case, the connection must be made bypassing the cert verification

    Connection: opening to smtp.gmail.com:587, timeout=300, options=array ( ‘ssl’ => array ( ‘verify_peer’ => false, ‘verify_peer_name’ => false, ‘allow_self_signed’ => true, ),)

    this allows the smtp connection to gmail

    please add this option to your plugin, to avoid these errors in this support thread

    I am updating site to add this plugin for client.
    Have got client ID and client secret and authorised redirect address.

    Doesnt authorise.

    Errorwhen trying to send test mail.

    Versions:
    WordPress: 4.9.5
    WordPress MS: No
    PHP: 5.6.12
    WP Mail SMTP: 1.2.5

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    I am too having this problem:

    Versions:
    WordPress: 4.9.5
    WordPress MS: No
    PHP: 7.1.14
    WP Mail SMTP: 1.2.5

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes
    Apache.mod_security: No

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Google API Error’ is closed to new replies.