0
我已經創建了一個Outlook自定義表單,並將它發送到我的收件箱。閱讀C#中的電子郵件表單數據#
現在,在我的代碼中,
ExchangeService exchange = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
exchange.UseDefaultCredentials = true;
exchange.AutodiscoverUrl("[email protected]", RedirectionUrlValidationCallback);
TimeSpan ts = new TimeSpan(0, -1, 0, 0);
DateTime date = DateTime.Now.Add(ts);
SearchFilter.IsGreaterThanOrEqualTo filter = new SearchFilter.IsGreaterThanOrEqualTo(ItemSchema.DateTimeReceived, date);
if (exchange != null)
{
Folder inbox = Folder.Bind(exchange, WellKnownFolderName.Inbox);
SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));
ItemView view = new ItemView(1);
FindItemsResults<Item> findResults = exchange.FindItems(WellKnownFolderName.Inbox, sf, view);
foreach (Item item in findResults)
{
EmailMessage message = EmailMessage.Bind(exchange, item.Id);
string messageBody = message.Body;
我可以得到主題,身體等,但我如何閱讀自定義窗體中的字段?
所以我有一個字段叫做textbox1。
在此先感謝。
輝煌。謝謝。 – griegs