从电子邮件中解析信息

时间:2017-05-07 22:18:20

标签: c# parsing

我的目标是从电子邮件中收集信息并删除除一些关键信息之外的所有信息,在这种情况下是一个名称。

以下是收到的示例电子邮件。我已经能够从Outlook中提取电子邮件并将所有正文文本加载到数据网格中,但我不确定如何解析信息并检索姓名和姓氏信息。

文字版

From: Company
Sent: Sunday, May 7, 2017 Eastern Time (US & Canada)
To: LastName, FirstName (CompanyName)
Subject: Thank you for your recent purchase.

Dear FirstName LastName,
Thank you for

HTML版本

<font face="Tahoma" size="2"><b>From:</b> Company<br>
<b>Sent:</b> Sunday, May 7, 2017(UTC-05:00) Eastern Time (US &amp; Canada)<br>
<b>To:</b> LastName, FirstName (CompanyName)<br>
<b>Subject:</b> Thank you for your recent purchase<br>
<font face="Tahoma" size="2"><b>From:</b> Company<br>
<b>Sent:</b> Sunday, May 7, 2017(UTC-05:00) Eastern Time (US &amp; Canada)<br>
<b>To:</b> LastName, FirstName (CompanyName)<br>
<b>Subject:</b> Thank you for your recent purchase<br>
</font><br>
<div></div>
<div>
<div id="left-align-on-reply" dir="ltr">
<div id="main">
<div id="logo-row-box" style="width:95%; text-align:right; padding-top:6%; padding-bottom:6%">
<img id="imagesent" src="image.png" style="display:inline-block; height:28px; width:24px; right:0px">
</div>
<table id="message-body-wrapper" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td id="message-body-left-margin" width="0"></td>
<td id="message-body">
<table id="paragraphs" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="paragraph" style="padding:0 5% 18px; font:300 14px/18px 'Lucida Grande',Lucida Sans,Lucida Sans Unicode,sans-serif,Arial,Helvetica,Verdana,sans-serif; color:#333">
Dear FirstName LastName,</td>
</tr>

0 个答案:

没有答案