• Resolved ayrton01cz

    (@ayrton01cz)


    Hello, I have a following issue with the Email Test. I can’t send any emails.

    Versions:
    WordPress: 4.7.8
    WordPress MS: No
    PHP: 7.0.15-0ubuntu0.16.04.4
    WP Mail SMTP: 1.2.2
    
    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: Yes
    
    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": "failedPrecondition",
    "message": "Bad Request"
    }
    ],
    "code": 400,
    "message": "Bad Request"
    }
    }
    Error while sending via Gmail mailer: {
    "error": {
    "errors": [
    {
    "domain": "global",
    "reason": "failedPrecondition",
    "message": "Bad Request"
    }
    ],
    "code": 400,
    "message": "Bad Request"
    }
    }
    • This topic was modified 7 years, 2 months ago by ayrton01cz.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Slava Abakumov

    (@slaffik)

    Hi @ayrton01cz,

    This might help you: https://developers.google.com/admin-sdk/reports/v1/guides/delegation#delegate_domain-wide_authority_to_your_service_account with a https://www.googleapis.com/auth/gmail.send scope.

    Please try and reply back with the results.

    Hello Slava,

    I have the exact same error-code (400). Surprisingly the error is not identical with the error given on:
    https://wpforms.com/how-to-securely-send-wordpress-emails-using-gmail-smtp/
    I am not sure if authentication is missing.

    Versions:
    WordPress: 4.9.4
    WordPress MS: No
    PHP: 7.2.2
    WP Mail SMTP: 1.2.5
    
    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: Yes
    
    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: No
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes
    
    Debug:
    Error while sending via Gmail mailer: {
    "error": {
    "errors": [
    {
    "domain": "global",
    "reason": "failedPrecondition",
    "message": "Bad Request"
    }
    ],
    "code": 400,
    "message": "Bad Request"
    }
    }

    Plugin and configuration has been done by simply following the instructions from my link above. No other SMTP or caching plugin is installed. Everything is up-to-date. Somehow I am assuming it might have sth to do with security restrictions I added. See error code line: PHP.allow_url_fopen: No
    I tried to follow the instructions you’ve given above, but I have no g suite account. Because I wasn’t sure where to put the https://www.googleapis.com/auth/gmail.send I tried it in my Gmail API (see scrrenshot: https://ibb.co/b8O5h7). You will find this part in the credentials tab -> restrictions.
    I will go through my .htaccess and functions.php to look for security restrictions I set. Hope to find the error and will report back, maybe someone else is having same issue.
    If you have other ideas leading to the goal, they are highly appreciated. ??

    Best regards,

    -Bj?rn

    Edit:
    Neither it was the implemented 6g firewall or xss-header configuration, nor the PHP.allow_url_fopen setting. This is set to ‘Yes’ now, but with same result.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Gmail SMTP issue’ is closed to new replies.