首页 > 解决方案 > Failure to set up the WP Mail SMTP plugin to use the Gmail API in my WordPress website

问题描述

I am trying to set up emails on my WordPress website using the WP Mail SMTP plugin and the Gmail API. (WordPress version 5.5.1; WP Mail SMTP Version 2.4.0)

The website I am trying to set this up on, https://souheganvalleychorus.org/ is part of a GSuite for non-profits domain.

I have followed the WP Mail SMTP setup instructions on:

https://wpmailsmtp.com/docs/how-to-set-up-the-gmail-mailer-in-wp-mail-smtp/

with meticulous care. However, when I get to the final step, where I click on the WP Mail SMTP plugin's setup page, and click on "Allow plugin to send emails using your Google account", get prompted with some dialog boxes, choose the email address that I used to set up the Gmail API, it finally comes back with a webpage that says simply:

Unauthorized

Back {a link}

the URL for this page is:

https://souheganvalleychorus.org/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=4/4AEw2mlaJPMgOg7boWHzLLDIJdg0Gwb98vGyJfrteQXcOE5cnL1HMj5wX6QSRZQ0x2rhrbxlzqKPBsF7uokdWCg&scope=https://mail.google.com/

I have been pulling my hair out trying to figure out what is happening, and what I can do to fix it. The 'Unauthorized' provides absolutely no additional information.

I have previously set up the WP Mail SMTP plugin to use the Gmail API, on another website (also a GSuite for non-profits domain, but a different one), and succeeded in that case. I seem to recall having had some problems setting that one up, too, but don't remember how I resolved the issue. When you do something (especially with such an arcane interface as the Google API interface) once in a blue moon, you tend to forget the details. I have tried to compare the two Gmail API setups, and can find no difference that would explain the failure in the current case.

I sure would appreciate anyone's help in resolving this. Until I do, I can't send email from the website. I've also tried using WP Mail SMTP's "Other SMTP" option, with the Gmail SMTP credentials, but that fails to authorize, so I'm stuck...

Help! (and thanks!)

标签: wordpressemail

解决方案


推荐阅读