用什麼方式可以從下面的字符串中使用python獲得'X-Mailer-recipient:'電子郵件ID。使用python從字符串獲取電子郵件ID的最佳方式
使用re?
Received: from localhost6.localdomain6 (unknown [59.92.85.188])
by smtp.webfaction.com (Postfix) with ESMTP id 05B332078BD1
for <[email protected]>; Fri, 26 Aug 2011 04:59:36 -0500 (CDT)
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: Test subject100
From: [email protected]
To: [email protected]
Date: Fri, 26 Aug 2011 10:01:39 -0000
Message-ID: <[email protected]>
X-Mailer-status: false
X-Mailer-recipient: [email protected]
感謝
這還包括電子郵件地址後面的任何文字。 – Spycho
@Spycho - 謝謝修復 –
感謝您的回答,其實X-Mailer收件人可能在字符串中間,我應該得到正確的電子郵件 – shivg