email - SendGrid 总是将我的电子邮件发送到收件人的垃圾邮件文件夹
问题描述
我正在尝试使用 SendGrid 的Node.js 邮件客户端从我的Firebase Cloud Functions发送电子邮件
我按照他们的例子描述如下:
const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(functions.config().sendgrid.key);
const msg = {
to: 'my_own_mail@gmail.com',
from: 'my_other_own_mail@gmail.com',
subject: 'Sending with Twilio SendGrid is Fun',
text: 'and easy to do anywhere, even with Node.js',
html: '<strong>and easy to do anywhere, even with Node.js</strong>',
};
sgMail.send(msg);
一旦函数被触发,一切都会成功执行。在我的函数日志中,我得到了状态 202,实际邮件被传递,但不是在主邮箱中,而是在垃圾邮件文件夹中。当我打开消息时,它只是说:
我真的不明白是什么问题。
注意:如果我将邮件发送到 Yahoo 电子邮件,它不会进入垃圾邮件文件夹。如果我将其发送到我的企业电子邮件,同样适用。
解决方案
您的问题与云功能或代码无关,您需要遵循一些反垃圾邮件规则,这给了我一个很好的起点
推荐阅读
- javascript - blob.text() 的逆运算
- python - ValueError: y 和 y_pred 必须具有相同的形状 (batch_size, num_categories, ...) 并且 num_categories > 1
- typescript - 如何对传递给字符串 indexOf 的值强制执行类型?
- swift - UICollectionView didSelectItemAt 方法不起作用
- powerbi - Power bi Slicer 可视化 - Month Wise
- mongodb - MongoDB 如何通过单个更新调用 $set 和 $inc?
- java - 如何覆盖文件中的前一个字节?
- database - 为什么不能导入数据库(Firebase)
- aws-api-gateway - AWS API Gateway Cognito 授权模拟
- android - 房间新功能自动迁移报错:不兼容的类型无法转换为List