1

我想用php修改那个eml文件的头信息:

我想删除 Line Message-ID 并且我想更改 Line To 中的邮件地址。例如,删除所有 3 个邮件地址并用另一个替换它...

有人可以帮助我吗?

Received: from server.local (7.6.19.14) by mail.local
 (192.168.0.1) with Microsoft SMTP Server id 8.3.298.1; Fri, 19 Jul 2013
 08:38:42 +0200
Received: by server.local (Postfix, from userid 1)  id 62C961608B7; Fri, 19
 Jul 2013 08:38:42 +0200 (CEST)
From: "mail@example.com" <mail@example.com>
To: Recipient <test@test.de>, Recipient <test@test.de>, 
Recipient <test@test.de>
Date: Fri, 19 Jul 2013 08:38:42 +0200
Subject: EG...
Thread-Topic: EG...
Thread-Index: Ac6ESpw8LCpOq4iNTOa02MkB6MTlsQ==
Message-ID: <20130719063842.62C961608B7@mail.local>
Accept-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: mail.local
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
Content-Type: multipart/mixed;
    boundary="_002_2013074498405156741_"
MIME-Version: 1.0
4

1 回答 1

0

这是一个相对简单的 preg_replace 问题....这应该可以满足您的需求。

$email = preg_replace('/^Message-ID: .*\n/m','', $email);
$email = preg_replace('/^To :(.*)\n/m', 'To: $1\n', $email);
于 2013-07-19T07:55:16.560 回答