【发布时间】:2022-04-03 14:45:44
【问题描述】:
我正在开发一个应用程序来检查 Outlook 邮件帐户,找到所有附件,然后将它们打印出来。此时,分析的邮件被移动到另一个文件夹。
我只有一个问题:有时,我会收到一些带有阅读确认的邮件。该应用程序检查附件,当它必须移动邮件时,它会冻结。然后在 Outlook 中出现一个弹出窗口,关于发送或不发送阅读确认。
现在,我想以编程方式进行,我总是想在请求时发送阅读确认。
我找到了一个属性(ReadReceiptRequested),如果有阅读确认要发送,则设置为true,但我不知道如何发送。
这是我使用的一段代码:
//I store all the emails in a List<Outlook.MailItem> named emails
Outlook.Application myApp = new Outlook.Application();
Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");
//Check if the mail has read confirmation
if (emails[right_index].ReadReceiptRequested)
{
//How to send read confirmation?
}
//I read the mail, then I move it to another folder
emails[indice_scelto].UnRead = false;
emails[indice_scelto].Move(mapiNameSpace.Folders["New folder"]);
你能帮我吗?
提前致谢!
【问题讨论】:
-
你能在阅读邮件的地方显示代码吗?
-
当然,我需要一点时间给代码添加一些注释。