开发者

VSTO MailItem.CC only has names, not emails

I'm trying to get MailItem.To .CC and .From and from what I've read it's supposed to be a semicolon delimited string.

I'm looking for "john@x.com;jane@x.com" but i'm getting back "John Smith;Jane Smith"

which is funny because the outlook address book does not contain any contacts so the name is coming from the john smith<john@x.com> format of the email.

How to i get around this? I found the MailItem.Recipients but i need to know开发者_如何学Python if it's a CC or not. Do I just have to check against the CC property?


Try this code

item = inspector.CurrentItem as MailItem;

foreach (Recipient recipient in item.Recipients)
            {
                if (recipient.Type == (int)OlMailRecipientType.olTo)
                {
                    //Do something
                }
            }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜