0

当发件人名称包含国家字符和点 (.) 字符时,“发件人:”标题的正确格式是什么?

我们生成(使用 C# Chilkat lib)这个:

From: =?utf-8?Q?Micha=C5=82_from_domain.com?= <abcdef@domain.com>

(其中 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?=<abcdef@domain.com>
^-missing end of mailbox

提供商坚持认为问题在于姓名和电子邮件之间缺少空格。这不是我们的情况(参见前面的代码示例)。

4

1 回答 1

0

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:

From: =?utf-8?Q?Micha=C5=82_from_domain=2Ecom?= <abcdef@domain.com>

(Note that the . has been replaced by its quoted-printable encoding, =2E.)

于 2011-01-14T21:28:47.297 回答