Tôi có thể tìm nạp email từ một hộp thư dựa trên một chủ đề. Tôi không chắc định dạng tìm nạp email dựa trên ngày nhận được là gì?Tìm nạp email cho một ngày cụ thể trong C# bằng cách sử dụng Dịch vụ Web Exchange
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;
}
Mã bạn đã cung cấp ở trên không tìm kiếm theo chủ đề. Nó lấy thông điệp bằng 'EntryID'. – SliverNinja