开发者

VSTO MailItem.CC only has names, not emails

开发者 https://www.devze.com 2023-01-22 12:59 出处:网络
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 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

精彩评论

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

关注公众号