1

そのemlファイルのヘッダー情報をphpで変更したい:

Line Message-ID を削除し、Line To のメールアドレスを変更したいです。たとえば、3つのメールアドレスをすべて削除して、別の1つに置き換える...

誰か助けてくれませんか?

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 に答える