2
如何在php imap lib中獲得X-Mailer屬性?在php中獲取X-Mailer屬性imap
我找不到任何屬性取功能http://php.net/manual/en/function.imap-fetchheader.php
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
$header = imap_fetchheader($inbox, 1);
var_dump($header);
/* close the connection */
imap_close($inbox);
輸出我得到的是
string(405) "MIME-Version: 1.0
Received: by 10.42.228.195; Wed, 16 Feb 2011 21:18:06 -0800 (PST)
Date: Wed, 16 Feb 2011 21:18:06 -0800
Message-ID: <[email protected]>
Subject: Get Gmail on your mobile phone
From: Gmail Team <[email protected]>
To: test case2 <[email protected]>
Content-Type: multipart/alternative; boundary=20cf302234f1c34163049c73853c
"
@Peter我添加代碼和O/P。 – 2011-04-12 07:03:15
在您的示例中,郵件沒有X-Mailer標題字段。 – 2011-04-12 07:30:16
@Vivek,我添加了一個例子,我測試了它,它對我來說工作正常。 – 2011-04-12 07:39:00