大量の電子メールを送信すると、SMTP サーバーで数百のエラーが発生しました。現在、多数の .BAD ファイルがあり、それぞれにエラー メッセージが含まれており、その中間に、実際に送信されるはずの電子メール アドレスが含まれています。
実際に失敗したメールのリストを取得できるように、各ファイルから「メールアドレス」だけを抽出する最も簡単な方法は何ですか?
私は C# でコーディングできます。どんな提案でも大歓迎です。
悪いサンプル テキスト:
From: postmaster@my.server.com
To: me@me.com
Date: Tue, 25 Sep 2012 12:12:09 -0700
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="9B095B5ADSN=_01CD9B35032DF58000000066my.server.co"
X-DSNContext: 7ce717b1 - 1386 - 00000002 - C00402D1
Message-ID: <FRaqbC8wS00000068@my.server.com>
Subject: Delivery Status Notification (Failure)
This is a MIME-formatted message.
Portions of this message may be unreadable without a MIME-capable mail program.
--9B095B5ADSN=_01CD9B35032DF58000000066my.server.co
Content-Type: text/plain; charset=unicode-1-1-utf-7
This is an automatically generated Delivery Status Notification.
Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server.
email@stackoverflow.com
--9B095B5ADSN=_01CD9B35032DF58000000066my.server.com
Content-Type: message/delivery-status
Reporting-MTA: dns;my.server.com
Received-From-MTA: dns;Social
Arrival-Date: Tue, 25 Sep 2012 11:45:15 -0700
Final-Recipient: rfc822;email@stackoverflow.com
Action: failed
Status: 4.4.7
--9B095B5ADSN=_01CD9B35032DF58000000066my.server.com
Content-Type: message/rfc822
Received: from Social ([127.0.0.1]) by my.server.com with Microsoft SMTPSVC(7.5.7601.17514);
Tue, 25 Sep 2012 11:45:15 -0700
email@stackoverflow.com
主に、メールを真ん中で見つけたいです。