• Resolved John Smith

    (@docsmith16)


    Hello All,

    I am a first time user so I apologize in advance for when I screw this up. I finished the plugin setup. However, I am getting the following error message. “Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential.”

    I went through the wizard step by step for the GMail API setup and received a success message. However, still no joy.

    Thanks for your help.

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Victoria Sakal

    (@sakalvictoria)

    Hi, @docsmith16!

    Thanks for reaching out!

    The error indicates that you haven’t performed an Authorization or it was broken for some reason.

    Please, check it by following the next steps: go to the WP Mail SMTP plugin -> Settings -> scroll down and verify if the Authorization is performed (as on the screenshot here).

    If not, perform the Authorization (please, look at the screenshot).

    If you’ll be facing some issues while this process, please, share the exact error message (screenshot of it) you are getting while performing the Authorization. And if you are redirected to another page while this process, share its URL.

    Kind regards.

    Thread Starter John Smith

    (@docsmith16)

    Hello Victoria,

    Thank you so much for your help. I have completed that step multiple times but no joy. I am still getting this error message.

    Heads up! The last email your site attempted to send was unsuccessful.

    Email Source: Constant Contact Forms for WordPress Mailer: Google / Gmail { “error”: { “code”: 401, “message”: “Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.”, “errors”: [ { “message”: “Login Required.”, “domain”: “global”, “reason”: “required”, “location”: “Authorization”, “locationType”: “header” } ], “status”: “UNAUTHENTICATED”, “details”: [ { “@type”: “type.googleapis.com/google.rpc.ErrorInfo”, “reason”: “CREDENTIALS_MISSING”, “domain”: “googleapis.com”, “metadata”: { “service”: “gmail.googleapis.com”, “method”: “caribou.api.proto.MailboxService.SendMessage” } } ] } }

    For more details please try running an Email Test or reading the latest error event.

    When I try to Send a Test Email the the Send Email button is grayed out with this error message. “You cannot send and email. Mailer is not properly configured. Please check your settings.”

    I have also noticed that the From Field is not populated with the email address.

    When I went in to the setting on the WP Mail SMTP it does not show the OAuth Connection has ever been made (authorized).

    Thanks so much for your help.

    Plugin Support Victoria Sakal

    (@sakalvictoria)

    Hi, @docsmith16!

    Thanks for following up!

    You are getting the “”code”: 401, “message”: “Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential.” error because “Google / Gmail” mailer authorization is not performed.

    Based on what I’ve seen, the “Constant Contact Forms for WordPress” plugin causes the conflict which prevents “Google / Gmail” mailer authorization.

    Please, follow the next steps to perform the mailer authorization:

    temporarily deactivate the “Constant Contact Forms for WordPress” plugin -> go to the WP Mail SMTP plugin and perform the authorization (screenshot) -> send a test email -> activate the “Constant Contact Forms for WordPress” plugin -> send a test email once more.

    I hope this helps!

    Thread Starter John Smith

    (@docsmith16)

    Hello Victoria,

    Thank you so much. I was zeroing in on the Constant Contact plugin being the source of the problem, but I had disconnected instead of deactivated. As soon as I completed your instructions I was able to complete the authorization process successfully and send a test email. I was then able to reconnect the Constant Contact plug-in. The Constant Contact form is for our mailing list/newsletter subscriptions. I was able to subscribe successfully and an email notification to our company email generated properly. The developer we had used to build this site had used the gravity forms plug-in for the website contact form. It worked successfully and generated an email to our business email account. There is a third form plugin named Contact Form 7. I do not think this is being used but the Goodlayers/Kleaniity theme might require it. I don’t understand why we need so many different form plugins. Seems to me this is asking for trouble, but that is something I can deal with later. However a new problem has emerged. This is the message from the Send a Test Email page within the WP Mail SMTP plug-in.

    The test email might have sent, but its deliverability should be improved.

    Domain Check Results

    error iconspf

    Action Needed: It doesn’t look like the SPF record required by Google has been added to your domain. Please check out Google’s SPF guide for details on how to add this record to your domain’s DNS.

    warning icondkim

    Action Needed: It doesn’t look like the DKIM record required by Google has been added to your domain. Please check out Google’s DKIM guide for details on how to add this record to your domain’s DNS.

    warning icondmarc

    Action Recommended: It doesn’t look like DMARC has been set up on your domain (sherryjsmith.com). We recommend using the DMARC protocol because it helps protect your domain from unauthorized use. Please check out our step-by-step guide for details on how to add this record to your domain’s DNS.

    I have found the documentation that goes with each of these actions, however when setting up the SPF, I am not sure whether I need the Basic Setup or the Advanced Setup. Are the emails generated by the site only coming from our Google Workspace(Basic Setup), or are they also being generated by the Constant Contact and Gravity Forms? This may be a stupid question but I am still coming to grips with how everything plays together.

    Thanks again for your help. You are a miracle worker. All the best.

    Plugin Support Victoria Sakal

    (@sakalvictoria)

    Hey, @docsmith16!

    I’m glad to hear that you were able to perform the authorization successfully!

    First of all, I’d like to share the main purpose of the WP Mail SMTP plugin.

    Please kindly know, that the WP Mail SMTP bridges a connection between your WordPress site and your email mailing service (chosen mailer).

    For example, you have a form on your website -> the user submits it -> sending of the notification email about the submission is triggered -> this email goes to the WP Mail SMTP plugin -> WP Mail SMTP plugin routes this email to the mailer -> mailer will send and deliver it further (so, emails from your site will be sent by mailing service instead of your web host’s server. This improves the reliability and efficiency of your email).

    WP Mail SMTP uses the wp_mail() function. So, any emails sent through the wp_mail() function on the website will be routed through our plugin.

    How to add an SPF record for your sender domain

    If you are using a domain-based From Email address (e.g. [email protected]), you’ll need to set up the needed DNS records (SPF, DKIM) for the sender domain (e.g. yourdomain.com).

    SPF record

    Add the 1 TXT record below:

    v=spf1 include:_spf.google.com ~all

    In the “@” box, add the domain for the site (e.g. yourdomain.com).

    If you already have an SPF record added, you’ll need to merge them by following this guide.

    I hope it helps!

    Best regards.

    Thread Starter John Smith

    (@docsmith16)

    Hello Victoria,

    Thanks again for you help. Once I was able to determine that the were no other SPF records, I was able to finish with that part of the setup.

    I am working on the DKIM authentication. The error message states “Email authentication was not verified. Please allow 48 hours for DNS to update and make sure you entered the correct TXT record into your domain provider’s DNS settings page.” If I am understanding things correctly, I wait 48 hours and log into the Google Workplace Admin Console, click start authentication and hope for the best. After that I will be able to tackle the DMARC recommended action. I will provide an update here on how things have gone.

    Thanks again,

    Plugin Support Victoria Sakal

    (@sakalvictoria)

    Hi, @docsmith16!

    Thanks for letting me know! And I believe everything will be sorted.

    I’m going to go ahead and close this thread for now. But if you’d need us to assist further, please feel welcome to continue the conversation.

    Have a great day! 🙂

    Thread Starter John Smith

    (@docsmith16)

    Thank you again Victoria. SPF, DKIM, and DMARC have all passed in the Test Email action. I suspect I will want to change the DMARC settings in the future, since I used the generic provided. But I will fight that dragon another day.

    Be well.

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

The topic ‘Cannot Send Test Email after setup with Gmail API’ is closed to new replies.