我正在使用 sengrdi api 发送电子邮件。我完成了文档中提到的域身份验证步骤。
现在,当我使用 [电子邮件受保护] 发送电子邮件时,它将进入垃圾邮件文件夹。
如果我使用 test@em207.domain.com 发送同一封电子邮件,电子邮件将转到收件箱文件夹。
em207.domain.com 是在 sendgrid 域认证屏幕下生成的 cname 记录主机值。
我在这里做错了什么?
这是我的代码。
const sgMail = require('@sendgrid/mail')
sgMail.setApiKey(MY_KEY);
const msg = {
to: '[email protected]', // Change to your recipient
from: '[email protected]', // works with em207.domain.com
subject: 'Sending with API test',
text: 'test email using sendgrid api',
html: '<strong> easy to do anywhere, even with Node.js</strong>',
}
sgMail
.send(msg)
.then(() => {
console.log('Email sent')
})
.catch((error) => {
console.error(error)
})
我在使用 SendGrid/Twilio 时遇到了同样的问题,有人能够找到解决方案或识别问题吗?