Converting exchange email to smtp email

二次信任 提交于 2019-12-02 16:21:35

问题


Is it possible to convert the exchange email to smtp email. I could find some help while googling, but the solutions are not feasible as I'm using the older version (outlook 2003).

When I check MailItem.SenderEmailAddress property the values in the property looks like this format

/O=MYCOMPANY/OU=COUNTRY/CN=RECIPIENTS/CN=joseph

I want to convert this to smtp email which should be

joseph@mail.com

回答1:


I am using this way for my .Net:

service.ResolveName(emailAddress.Address).First().Mailbox.Address
// emailAddress.Address = "/o=ExchangeLabs/ou=Exchange(abc)/cn=Recipients/cn=xyz"
// => abc@xyz.com

ResolveName method reference: https://msdn.microsoft.com/en-us/library/dd635548(v=exchg.80).aspx

I am using .Net instead of VBA. However hope will inspire your VBA code.




回答2:


MailItem.Sender.GetExchangeUser().PrimarySmtpAddress

I know this works for Outlook 2010, but your mileage may vary with 2003.




回答3:


I found the solution at this link.

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_26868648.html

Its a simple and effective solution.



来源:https://stackoverflow.com/questions/13516624/converting-exchange-email-to-smtp-email

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!