当我执行以下代码时,出现错误the item is moved or deleted
Outlook.Application outlookApp = new Outlook.Application();
Outlook.MailItem mailItem = (Outlook.MailItem)outlookApp.CreateItem(Outlook.OlItemType.olMailItem);
mailItem.Subject = mailSubject;
mailItem.To = "";
mailItem.CC = "";
mailItem.Attachments.Add(totalPath);
mailItem.Body = mailBody;
mailItem.Importance = Outlook.OlImportance.olImportanceNormal;
mailItem.Display(true);
//Mail is send succesfully?
Bool sent = true;
if (!mailItem.Sent)
{
sent = false;
}
当我检查 mailItem.Sent 属性时出现错误。
我的问题是如何.Sent
工作?我正在尝试向最终用户显示电子邮件,然后检查他们是否已发送电子邮件。