简体   繁体   English

发送电子邮件到Outlook Exchange联系电子邮件地址

[英]Send Email to Outlook Exchange Contact Email Address

I read from Outlook Contacts my Contacts and then I add the Contact to MailMessage mail.To.Add("John Doe <John Doe>") but I receive this error: 我从Outlook联系人我的联系人中读取,然后我将联系人添加到MailMessage mail.To.Add("John Doe <John Doe>")但我收到此错误:

The specified string is not in the form required for an e-mail address. 指定的字符串不是电子邮件地址所需的格式。

How can I resolve this? 我该如何解决这个问题? when I read from Outlook Contacts the result for email address is a long string like this ( only for Exchange account types ) and I prse to get the last cn= value: /o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=John Doe 当我从Outlook联系人中读取时,电子邮件地址的结果是一个这样的长字符串( 仅适用于Exchange帐户类型 ),我解析得到最后一个cn =值: /o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=John Doe

How can I read the correct e-mail address from an Exchange Account ( jDoe@example.com ) or other method to send e-mail? 如何从Exchange帐户( jDoe@example.com )或其他发送电子邮件的方法中读取正确的电子邮件地址?

If you have an ExchangeUser , you can access the property PrimarySmtpAddress for the Exchange email. 如果您有ExchangeUser ,则可以访问Exchange电子邮件的属性PrimarySmtpAddress Then the following should work for you... 那以下应该对你有用......

MailMessage mail = new MailMessage();
mail.To.Add(exchangeUser.PrimarySmtpAddress);

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

相关问题 Outlook帐户-如何获取Exchange电子邮件地址? - Outlook Accounts - How to get the Exchange Email address? C#通过电子邮件地址找到Outlook联系人 - c# find outlook contact by email address C# VSTO Outlook 插件 - 如何使用传出 Z0C83ZEFA57C7831CEB7B24 获取发送方的 email 地址? - C# VSTO Outlook plugin - How can I get the email address of the sender of an outgoing email using Exchange? 如何使用联系人的电子邮件地址从Exchange Server查找联系人 - How to find a contact from Exchange Server using contact's email address Lync API:如何通过电子邮件地址发送即时消息给联系人? - Lync API: How to send instant message to contact by email address? 如何使用特定的电子邮件地址发送Outlook Mailitem? - How to send an outlook mailitem using specific email address? 联系人选择器获取电子邮件地址 - Contact Picker get Email address Outlook Exchange Office 365:如何从访问令牌获取电子邮件地址? - Outlook Exchange Office 365: How to get email address from access token? 在VSTO中使用交换电子邮件搜索Outlook收件箱 - Search outlook inbox with exchange email in VSTO 从联系表格发送电子邮件 - Send email from contact form
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM