我有以下代码从配置为发件人" noreply帐户的帐户向我的用户发送电子邮件,另外我添加了以下转发过滤器":失败:此地址没有这样的人。 "进入CPanel。
但是我收到了Nodemailer的错误,所以我的问题是我如何使用带有nodemailer的非反复过滤器,我可以做的任何技巧,包括可能更改"来自"字段显示收件人" noreply"帐户作为发件人,可能还可以通过其他帐户发送?
请注意,当我从CPanel中删除过滤器时,发送功能正常。
const mailTransport = nodemailer.createTransport({
host: 'mail.myserver.com',
port: 465,
secure: true, // true for 465, false for other ports
auth: {
user: 'noreply@myserver.com',
pass: smtpPassword
},
tls: {
// do not fail on invalid certs
rejectUnauthorized: false
}
});
const mailOptions = {
from: `App <noreply@myserver.com>`,//`${APP_NAME} <${REPLY_EMAIL}>`,//
to: email
};
// The user subscribed to the newsletter.
mailOptions.subject = subject
mailOptions.text = text;
return mailTransport.sendMail(mailOptions)
.then(() => console.log(log, email))
.catch(error => console.error('There was an error while sending the email:', error));
**Nodemailer error log:**
550-No such person at this address.
550 Sender verify failed
code: 'EENVELOPE',
response: '550-Verification failed for <noreply@myserver.com>\n550-No such person at this address.\n550 Sender verify failed',
responseCode:550, 命令:&#39; RCPT TO&#39;,