email - 使用 MailGun 发送邮件时删除 'on behalf of'

标签 email go mailgun dkim

我试图弄清楚如何使用 MailGun Golang API 发送邮件,而不是“代表”发送邮件。

这是 From 地址当前的样子(其中 foo.com 是发件人的电子邮件域,bar.com 是我的域):

john=foo.com@mail.bar.com on behalf of John Smith <john@foo.com>

我需要做什么才能让它看起来像这样:

John Smith <john@foo.com>

我已经根据 MailGun 的说明设置了 SPF 和 DKIM,并且一切正常。我在发送邮件时也使用了 SetDKIM(true)。我是否缺少某些设置或需要进行其他验证?

最佳答案

您需要设置sender电子邮件 header 中的属性也很可能指向发件人地址。

我在 node.js 项目中使用 NodeMailer 时遇到了同样的问题。 Gmail 和 Thunderbird 会正常显示发件人地址,但 Outlook 会将发件人地址显示为

emailname=example.com@mail.example.com on behalf of emailname@example.com

当我查看完整的电子邮件标题时,我看到 sender:在标题中是 emailname=example.com@mail.example.comfrom:emailname@example.com

我们起初查看了 spf 和 dkim 记录,认为这是一个问题,但它们很好,在电子邮件标题中甚至说 spf 和 dkim 都通过了,所以我注意到发件人标题与 from 和Outlook 会关注 gmail 和 Thunderbird 不太关心的地方。

尝试设置 sender from 的标题值(value)。

这里是一个错误的电子邮件标题的一部分,它被编辑以匹配上面的示例

Received-SPF: pass (google.com....
Authentication-Results: mx.google.com;
       dkim=pass header.i=@mail.example.com;
       spf=pass (google.com.....
Sender: emailname=example.com@mail.example.com
From: Persons Name <emailname@example.com>

制作 Sender等于 Sender: Persons Name <emailname@example.com>

关于email - 使用 MailGun 发送邮件时删除 'on behalf of',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28401673/

相关文章:

MeteorJS Mailgun Webhook 退回事件

node.js - 如何使用 mailgun 和 nodejs 发送批量个性化电子邮件

c# - Exchange Managed API - 所有返回的 EmailMessages 都具有相同的唯一 ID 字符串

c# - 电子邮件验证(不仅仅是正则表达式)

java - 如何使用 Java Mail API 检索任何电子邮件的电子邮件正文

javascript - 来自 Firefox 的错误 : MIME type (“text/plain” ) mismatch (X-Content-Type-Options: nosniff)

html - 如何使用 VML 在 Outlook 中获取 html 电子邮件中的圆形图像?

go - 如何用 Go 语言编译程序?

go - append 到实现的基本接口(interface) slice 的 slice

http - 网址获取应用程序 : how to simulate a HTTP post that have params with same name multiple times