MIME“发件人:”带有国家字符的标题
当发件人名称包含国家字符和点 (.) 字符时,“发件人:”标题的正确格式是什么?
我们生成(使用 C# Chilkat lib):(
From: =?utf-8?Q?Micha=C5=82_from_domain.com?= <[email protected]>
其中 From Name = 来自domain.com 的 Michał)
这在大多数情况下都可以正常工作。但是,我们遇到了一个电子邮件提供商,该提供商将此标头标记为无效并使用 Return-Path 标头(仅机器可读)。
错误是:
Illegal-Object: Syntax error in From: address found on ps11.m5r2.onet:
From: =?utf-8?Q?Micha=C5=82_from_domain.com?=<[email protected]>
^-missing end of mailbox
提供商坚持认为问题是姓名和电子邮件之间缺少空格。我们的情况并非如此(请参阅前面的代码示例)。
What is the correct format of "From:" header when From Name contains national characters and dot (.) character?
We generate (using C# Chilkat lib) this:
From: =?utf-8?Q?Micha=C5=82_from_domain.com?= <[email protected]>
(where From Name = Michał from domain.com)
This works OK in most cases. However, we encountered an email provider which marks this header as invalid and uses Return-Path header instead (which is machine-readable only).
The error is:
Illegal-Object: Syntax error in From: address found on ps11.m5r2.onet:
From: =?utf-8?Q?Micha=C5=82_from_domain.com?=<[email protected]>
^-missing end of mailbox
The provider insists the the problem is the lack of space between name and email. This is not the case on our end (see previous code example).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该电子邮件提供商的 MTA 已损坏。不幸的是,你必须处理它。
您已经将非 ASCII“发件人”个人部分格式化为 RFC 2047 编码字。由于您使用
Q
作为编码,因此您可以利用引用打印编码的灵活性并对.
进行编码:(请注意,
>.
已被其引用的可打印编码=2E
取代。)That email provider has a broken MTA. Unfortunately, you have to deal with it.
You're already formatting your non-ASCII "From" personal-part as an RFC 2047 encoded-word. Since you're using
Q
as the encoding, you can take advantage of the flexibility in the quoted-printable encoding and encode the.
as well:(Note that the
.
has been replaced by its quoted-printable encoding,=2E
.)