如何在sendMail文件夹中查找Outlook项目 [英] how to find outlook items in sentMail folder

查看:118
本文介绍了如何在sendMail文件夹中查找Outlook项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要从Outlook发送邮件,其中toMailAddress为"prasanna@qa.com"的邮件文件夹

为此我做了这样的

I want items from outlook sentMail Folder where toMailAddress is "prasanna@qa.com"

for that i have done like this

oSents.Items.Restrict("[RecipientEmailAddress]='prasanna@qa.com'");



但是我收到错误消息"RecipientEmailAddress"不是属性.



but i am getting error "RecipientEmailAddress" is not a property.

推荐答案



您需要在项目中添加对"Microsoft.Office.Interop.Outlook"的引用,然后使用此代码:
Hi,

you need to add a reference to "Microsoft.Office.Interop.Outlook" to your project and then use this code:
using OutLook = Microsoft.Office.Interop.Outlook;

OutLook.Application oApp;
OutLook._NameSpace oNS;
OutLook.MAPIFolder oFolder;

oApp = new OutLook.Application();
oNS = (OutLook._NameSpace)oApp.GetNamespace("MAPI");
oFolder = oNS.GetDefaultFolder(OutLook.OlDefaultFolders.olFolderSentMail);

OutLook.Items items = oFolder.Items;
foreach (OutLook.MailItem mail in items)
{
}


这篇关于如何在sendMail文件夹中查找Outlook项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆