我能够根据主题从邮箱中获取电子邮件。我不确定根据接收日期获取电子邮件的格式是什么?
string message = string.Empty;
Item item = Item.Bind(exService, messageID, PropertySet.FirstClassProperties);
if (item is EmailMessage)
{
EmailMessage em = (EmailMessage)item;
string strMsg = string.Empty;
//strMsg = strMsg + item.Id.ToString();
//strMsg = strMsg + item.DateTimeReceived;
strMsg = strMsg + "*********************** New Fiscal Email received on " + item.DateTimeReceived +" ************************************" + Environment.NewLine;
if (em.Body.Text.Contains("BRANDON"))
{
strMsg = strMsg + em.Body.Text.ToString();
}
strMsg = strMsg + "*********************** End of Email Body ************************************" + Environment.NewLine;
message = strMsg;
}