本文介绍了我们如何获得 Outlook 收件人的实际电子邮件地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望能得到一点帮助来解决今天难倒我的问题:

Hoping to get a little help with this one that has stumped me today:

Outlook.MailItem mail = (Outlook.MailItem)Item;
Outlook.Recipients recips = mail.Recipients;
string toField = recips[1].Address;

我没有得到返回的实际地址.我已经尝试过 MSDN 站点上的建议,但没有成功.具体来说,PR_SMTP_ADDRESS 服务已死:

I'm not getting the actual address returned. I've tried suggestions on the MSDN site with no luck. Specifically, the PR_SMTP_ADDRESS service is dead:

Const PR_SMTP_ADDRESS As String = _
    "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"

非常感谢你们提供的任何帮助.

Thanks very much in advance for any help you all can provide.

推荐答案

使用 Recipient.AddressEntry 获取 AddressEntry 对象.检查AddressEntry.Type属性,如果是SMTP,就使用AddressEntry.Address.如果是EX,则使用AddressEntry.GetExchangeUser.PrimarySmtpAddress.

Use Recipient.AddressEntry to get the AddressEntry object. Check if the AddressEntry.Type property, if it is SMTP, just use AddressEntry.Address. If it is EX, use AddressEntry.GetExchangeUser.PrimarySmtpAddress.

这篇关于我们如何获得 Outlook 收件人的实际电子邮件地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 23:54