在base64编码的电子邮件中

时间:2011-11-16 17:21:16

标签: php email outlook mime

我遇到瑞典语+ MS Outlook的问题。

除了MS Outlook之外,这一切都很好用。在MS Outlook中,瑞典字符显示为 。电子邮件内容是base64编码,uft-8等。可能出错?

附录:

这是消息:

============================================================  
Header 
============================================================ 

*** NY Beställning *** 

Ni har fått ny beställning från: FirstAccount 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
Beställnings-ID: FA12914-1  
Beställningsdetaljer: http://somelink
Beställningsdatum: 11/14/2011 11:16  
Önskat leveransdatum:   
Ordersedel: http://somlink 
Original: <http://somelink> 
Product: New stuff 
Product ID:   
Description:  
Qty: 11 
Job type: Release from stock

Kommenar:  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


_______________________________________________________________ 
Copyright (c) 2011 Someone

这是来源:

Return-path: <test@example.com>
Envelope-to: admin@example.com
Delivery-date: Mon, 14 Nov 2011 11:17:00 +0000
Received: from somewhere ([123.456.789.012])
        by someone.co.uk with esmtp (Exim 4.69)
        (envelope-from <test@example.com>)
        id 1RPuX1-0006sU-HG
        for admin@example.com; Mon, 14 Nov 2011 11:16:58 +0000
Received: by someone.co.ul (Postfix, from userid 33)
        id B743C4EB7F; Mon, 14 Nov 2011 11:16:52 +0000 (UTC)
To: "Admin" <admin@example.com>
Subject: Ny beställning har kommit in från ace Beställnings-ID: FA12914-1
From: test@example.com
X-Mailer: Html Mime Mail Class
MIME-Version: 1.0
Content-Type: multipart/mixed;

   boundary="=_41bea315b9b2f2301a97632f8d6c3057"
Message-Id: <20111114111652.B743C4EB7F@li214-208.members.linode.com>
Date: Mon, 14 Nov 2011 11:16:52 +0000 (UTC)
X-Spam-Status: No, score=1.4
X-Spam-Score: 14
X-Spam-Bar: +
X-Ham-Report: Spam detection software, running on the system "somewhere", has
   identified this incoming email as possible spam.  The original message
   has been attached to this so you can view it (if it isn't spam) or label
   similar future email.  If you have any questions, see
   the administrator of that system for details.
X-Spam-Flag: NO


This is a MIME encoded message.

--=_41bea315b9b2f2301a97632f8d6c3057
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64

PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09

PT09IA0KYWNlIA0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09

PT09PT09PT09PT09PT09IA0KICAgICAgICAgICAgICAgIA0KKioqIE5ZIEJlc3TDpGxsbmluZyAq

KiogDQ........

--=_41bea315b9b2f2301a97632f8d6c3057--

1 个答案:

答案 0 :(得分:1)

粘贴的消息源似乎在Content-Type:标头的中间有一个虚假的换行符。它应该是一条逻辑线;虽然也许你粘贴错了(收到:标题至少没有正确粘贴)。在base64正文部分中似乎发生了类似的事情 - 我们在数据行之间看到空行。

看起来像这样:

Content-Type: multipart/mixed;

boundary="=_41bea315b9b2f2301a97632f8d6c3057"

应该是:

Content-Type: multipart/mixed;
   boundary="=_41bea315b9b2f2301a97632f8d6c3057"

在“boundary”关键字之前至少有一个空白字符;甚至

Content-Type: multipart/mixed; boundary="=_41bea315b9b2f2301a97632f8d6c3057"

此外,如果主题行包含8位数据,则​​应对RFC2047进行编码。

Subject: =?utf-8?Q?Ny_best=C3=A4llning_har_kommit_in_fr=C3=A5n_ace_Best=C3=A4llnings-ID:_FA12914-1?=

删除换行符后,正文部分中的base64数据看起来是正确的,即单词“Beställning”正确显示(虽然它应该是正确的;但也许有一个Swedish.stackexchange.com来批评你的复制?: - )

X-Mailer:标题表示您正在使用一个软件生成这些消息;它可能有选择正确地做这些事情,但你没有使用它们。这是一个编程论坛,所以你应该向我们展示你的代码,并用适当的编程语言标记问题。