我使用下面的代码从邮件中提取标题详细信息.. 我无法从 from、to 和 cc 中获取邮件地址,如下所述..
$header = explode("\n", imap_fetchheader($mbox,$msgno));
echo "<br>";
for ($i=1; $i<count($header); $i++)
{
echo $header[$i] . "<br>";
}
output:
Delivered-To: user1@examplecom
X-WM-Delivered: user1@example.com
Received: from ElcotPC ([127.0.0.1])
(envelope-sender )
by 127.0.0.1 with ESMTP
for ; Wed, 31 Jul 2013 09:14:19 +0530
From: "user1"
To:
Cc:
Subject: testing with attachment
Date: Wed, 31 Jul 2013 09:14:18 +0530
“发件人”、“收件人”、“抄送”字段为空,没有邮件地址。
我想要这样的输出..
Delivered-To: user1@examplecom
X-WM-Delivered: user1@example.com
Received: from ElcotPC ([127.0.0.1])
(envelope-sender )
by 127.0.0.1 with ESMTP
for ; Wed, 31 Jul 2013 09:14:19 +0530
From: "user1" <user1@example.com>
To: <user2@example.com>
Cc: <user1@example.com>
如何获取“发件人”、“收件人”和“抄送”字段的电子邮件地址?