我在谷歌API控制台面板上启用了Gmail API。
我创建了选择OAuth客户端Id、web应用程序和'
https://developers.google.com/oauthplayground
'作为授权重定向uri。
我通过使用上述凭据在OAuth 2.0游戏场中玩并启用
https://mail.google.com/
const mailer = require('feathers-mailer');
const smtpTransport = require('nodemailer-smtp-transport');
app.use('/api/mailer', mailer(smtpTransport({
service: 'gmail',
host: 'smtp.gmail.com',
port: 587,
secure: false,
requireTLS: true,
auth: {
type: 'OAuth2',
user: app.get('gmail'),
scope: 'https://mail.google.com/',
clientId: app.get('gmail_secret').client_id,
clientSecret: app.get('gmail_secret').client_secret,
refreshToken: app.get('gmail_credentials').refresh_token
}
})));
我得到了错误535:用户名和密码不被接受,包括“命令:auth plain”,以防万一。
我确信这些应用程序得到了正确的值,因为
我已经用精确的值替换了应用程序get,但它仍然给出了相同的错误。
我还尝试了删除“host”、“port”、“secure”、“requireTLS”的auth对象。同样的错误。
我尝试了身份验证:主机:'smtp。gmail。com',端口:'465',安全:true。同样的错误。
在本地环境中,以防有助于修复错误。
如何修复此535错误?