尝试发送电子邮件时遇到纯文本错误。我已经尝试了所有端口465,如果您想知道的话,请确保它为true。我曾经在某一点上工作过,但现在它继续抛出此错误。我没有改变它只是停止工作的任何事情:
app.post("/", function(request, response) {
// create reusable transporter object using the default SMTP transport
const transporter = nodemailer.createTransport({
host: "smtp.gmail.com",
port: 587,
secure: false,
auth: {
type: process.env.SMTP_TYPE,
user: process.env.SMTP_USER,
clientId: process.env.SMTP_CLIENTID,
clientSecret: process.env.SMTP_clientSecret,
refreshToken: process.env.SMTP_refreshToken,
accessToken: process.env.SMTP_accessToken
}
});
这是错误:
Error: Missing credentials for "PLAIN"
at SMTPConnection._formatError (C:\Users\Logan\Downloads\AsociacionCorazonDiverso\form-mailer\node_modules\nodemailer\lib\smtp-connection\index.js:784:19)
at SMTPConnection.login (C:\Users\Logan\Downloads\AsociacionCorazonDiverso\form-mailer\node_modules\nodemailer\lib\smtp-connection\index.js:448:38)
at C:\Users\Logan\Downloads\AsociacionCorazonDiverso\form-mailer\node_modules\nodemailer\lib\smtp-transport\index.js:271:32
at SMTPConnection.<anonymous> (C:\Users\Logan\Downloads\AsociacionCorazonDiverso\form-mailer\node_modules\nodemailer\lib\smtp-connection\index.js:215:17)
at Object.onceWrapper (events.js:416:28)
at SMTPConnection.emit (events.js:310:20)
at SMTPConnection._actionEHLO (C:\Users\Logan\Downloads\AsociacionCorazonDiverso\form-mailer\node_modules\nodemailer\lib\smtp-connection\index.js:1313:14)
at SMTPConnection._processResponse (C:\Users\Logan\Downloads\AsociacionCorazonDiverso\form-mailer\node_modules\nodemailer\lib\smtp-connection\index.js:942:20)
at SMTPConnection._onData (C:\Users\Logan\Downloads\AsociacionCorazonDiverso\form-mailer\node_modules\nodemailer\lib\smtp-connection\index.js:749:14)
at TLSSocket.SMTPConnection._onSocketData (C:\Users\Logan\Downloads\AsociacionCorazonDiverso\form-mailer\node_modules\nodemailer\lib\smtp-connection\index.js:195:44) {
code: 'EAUTH',
command: 'API'
}