【问题标题】:The from address does not match a verified Sender Identity发件人地址与已验证的发件人身份不匹配
【发布时间】:2021-06-22 15:47:54
【问题描述】:

作为所有者,我已经在sendgrid 中验证了我的 gmail,当我使用所有者邮件帐户发送消息时它已经发送,但是当我尝试以不同邮件帐户的客户身份发送邮件时,然后显示错误像这样:这意味着客户还需要使用 sendGrid 验证他们的邮件帐户?

{
  errors: [
    {
      message: 'The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements',
      field: 'from',
      help: null
    }
  ]
}

我不知道为什么。

我已经尝试过这样的代码:

const sgMail = require("@sendgrid/mail");
sgMail.setApiKey(process.env.SENDGRID_API_KEY);

exports.contactForm = (req, res) => {
  const { email, name, message } = req.body;

  const emailData = {
    to: process.env.EMAIL_TO,
    from: email,
    subject: `Contact form - ${process.env.APP_NAME}`,
    text: `Email received from contact from \n Sender name: ${name} \n Sender email: ${email} \n Sender message: ${message}`,
    html: `
            <h4>Email received from contact form:</h4>
            <p>Sender name: ${name}</p>
            <p>Sender email: ${email}</p>
            <p>Sender message: ${message}</p>
            <hr />
            <p>This email may contain sensetive information</p>
 
        `,
  };

  sgMail
    .send(emailData)
    .then(() => {
      console.log("Message sent");
    })
    .catch((error) => {
      console.log(error.response.body);
    });
};

请有任何建议。

【问题讨论】:

    标签: javascript node.js email sendgrid


    【解决方案1】:

    Sendgrid(以及其他批量电子邮件供应商)要求您发送每封电子邮件消息的发件人:一个知名地址。您不能通过 Sendgrid 发送邮件,因此它看起来像是来自任意未经验证的电子邮件帐户。

    为什么不呢?垃圾邮件。

    像 Sendgrid 这样的公司为了防止他们的客户使用他们的服务发送垃圾邮件而费了很大的力气。如果他们让客户发送垃圾邮件,他们的服务器将被 gmail、outlook 和其他大型电子邮件提供商阻止,并出现在小型电子邮件提供商使用的反垃圾邮件阻止列表中。如果发生这种情况,很快就会破坏他们的业务。

    因此,您在 Sendgrid 消息中声明为“发件人”地址的任何电子邮件帐户都必须经过验证。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-12-23
      • 2023-03-13
      • 2018-11-16
      • 1970-01-01
      • 2017-09-23
      • 2020-10-13
      • 2012-12-15
      相关资源
      最近更新 更多