繁体   English   中英

配置多个帐户时,使用C#(VSTO或兑换)从新打开的Outlook邮件检查器中获取SMTP发件人地址

[英]Get the SMTP sender address from new opened Outlook mail inspector with C# (VSTO or redemption) when multiple accounts configured

我尝试了不同的方法,但是当可以在Outlook中选择多个帐户时,我找不到能确定从Outlook 2007到Outlook 2013可靠的发件人地址的方法。

我的插件是基于Add-In Express构建的。

目的是从活动的邮件项目(活动的mailinspector)获取帐户发件人地址。

inspector = (AddinModule.CurrentInstance.OutlookApp as Outlook.Application).ActiveInspector();
mailitem = inspector.CurrentItem as Outlook.MailItem;

在Outlook 2013中,可以使用:

mailitem.SendUsingAccount.CurrentUser.AddressEntry.Address

当我的加载项在Outlook 2010或2007上运行时,如何获取发件人地址?

Outlook 2007中添加了SendUsingAccount,所以您应该不错。 我不确定您为什么要使用mailitem.SendUsingAccount.CurrentUser.AddressEntry.Address您将始终获得默认Outlook帐户的地址。 您是否尝试过使用mailitem.SendUsingAccount.SmtpAddress

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM