ruby-on-rails - 无法使用 Mailgun 将电子邮件发送到自定义域(非 Gmail/hotmail 电子邮件)

标签 ruby-on-rails email mailgun

我会在用户注册时发送确认邮件(和其他电子邮件)。问题是当我发送到不是 gmail 或 hotmail 或任何更大的电子邮件服务的地址时,它会在电子邮件标题中抛出一个错误。

{
  "severity": "permanent",
  "tags": [],
  "delivery-status": {
    "tls": false,
    "mx-host": "mxer.customdomain.com",
    "code": 553,
    "description": null,
    "session-seconds": 6.566637992858887,
    "message": "553 5.1.8 <user@customdomain.com>... Domain of sender address bounce+e06614.0f9698-user=customdomain.com@mg.mydomain.com does not exist",
    "certificate-verified": false
  },
  "envelope": {
    "transport": "smtp",
    "sender": "accounts@mydomain.com",
    "sending-ip": "123.45.678.900",
    "targets": "user@customdomain.com"
  },
  "recipient-domain": "customdomain.com",
  "id": "AbCDeFGhiJk_lMn",
  "campaigns": [],
  "reason": "generic",
  "user-variables": {},
  "flags": {
    "is-routed": null,
    "is-authenticated": true,
    "is-system-test": false,
    "is-test-mode": false
  },
  "log-level": "error",
  "timestamp": 1456123374.411238,
  "message": {
    "headers": {
      "to": "First Last <user@customdomain.com>",
      "message-id": "56caade72ed26_***********9@6e5120c5-0d27-4491-a430-1a2dc4e6b862.mail",
      "from": "Team Accounts <accounts@mydomain.com>",
      "subject": "Confirmation instructions"
    },
    "attachments": [],
    "recipients": [
      "user@customdomain.com"
    ],
    "size": 1143
  },
  "recipient": "user@customdomain.com",
  "event": "failed"
}

我是否错误地设置了 header ,或者在我可以将电子邮件发送到自定义域之前是否需要设置配置?

最佳答案

似乎对于某些电子邮件服务,它需要您的域/子域的有效“接收”MX 记录(对于 Mailgun,它是 mg.mydomain.com)以验证发件人的身份.我添加了MX记录

10 mxa.mailgun.org
10 mxb.mailgun.org

mg.mydomain.com 似乎有效。

关于ruby-on-rails - 无法使用 Mailgun 将电子邮件发送到自定义域(非 Gmail/hotmail 电子邮件),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35547414/

相关文章:

django - Pythonanywhere 出现 Mailgun 404 错误

python - 如何在 heroku 上配置 mailgun 附加组件

ruby-on-rails - Rails API 版本控制,路由问题

ruby-on-rails - 从日期集合中查找平均日期(Ruby)

ruby-on-rails - Rails 如何查询关联定义

android - 知道android :onClick came from and retrvieve children data在哪里

node.js - 通过 mailgun 发送邮件

javascript - 如何在 Rails 中正确管理用户的时区?

email - 如何使用 Oauth2 阅读用户的 Outlook 电子邮件?

javascript - 在线表单更新谷歌表格后如何发送电子邮件?