0
我正在做這個管道PHP腳本,獲取到達的電子郵件和解析它並顯示它。我使用這個教程:http://www.damnsemicolon.com/php/parse-emails-in-php-with-email-piping-part-1(和下面的),我用一個標準的電子郵件發送給我的服務器,它確實工作正常,但後來我嘗試了另一個,我得到了很多錯誤。我使用了print_r($譯碼);向我展示電子郵件的所有不同部分,而不是獲得完全解析電子郵件,電子郵件的所有內容都轉到$ decode [0] ['body];這是爲什麼發生? (我不會發布代碼,因爲它與教程相同)PHP腳本管道電子郵件解析
print_r($decode)= Array (
[0] => Array (
[Headers] => Array ()
[Parts] => Array ()
[Position] => 0
[Body] => From [email protected] Thu Apr 26 12:33:44 2012 Received: from [192.168.1.92] by ubuntuserver.lan with esmtp (Exim 4.76) (envelope-from) id 1SNMxE-0000VB-TR for [email protected]; Thu, 26 Apr 2012 12:33:44 +0100 Message-ID: <[email protected]> Date: Thu, 26 Apr 2012 12:33:45 +0100 From: =?ISO-8859-1?Q?=22Jo=E3o_Ferreira_=28m=E1quina_virtual=29=22?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: [email protected] Subject: Sample Email Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit It's the same?
[BodyPart] => 1
[BodyLength] => 744
)
)
謝謝。
然後你的解碼庫可能有問題。注意'From'行之前的主要UTF-8 BOM。這可能會搞砸了。 – mario 2012-04-26 16:32:38