[英]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.