![](/img/trans.png)
[英]How to determine if there is a valid Lync user by email using Lync SDK?
[英]How check an email address is valid Lync User?
我嘗試通過以下方法確認 email 地址是否為有效的 Lync 用戶,但沒有給出正確的結果。
LyncClient client = LyncClient.GetClient();
Contact contact = client.ContactManager.GetContactByUri("xxx@xxx.com");
方法一:
if(contact.UnifiedCommunicationType == UnifiedCommunicationType.Enabled)
{
}
else if(contact.UnifiedCommunicationType == UnifiedCommunicationType.NotEnabled)
{
}
else if(contact.UnifiedCommunicationType == UnifiedCommunicationType.Unknown)
{
}
在這種方法中,我得到隨機 email 地址未知和有效 Lync 用戶 NotEnabled。 但是,我沒有得到“無效”。
方法二:
ContactType contact_type = (ContactType)contact.GetContactInfomration(ContactInformationType.ContactType);
if(contact_type == ContactType.Person)
{
}
else if(contact_type == ContactType.Invalid)
{
}
else if(contact_type == ContactType.Unknown)
{
}
在這種方法中,無論電子郵件地址如何,我都會得到“Person”。 因此,我不是這樣的。
你能告訴我如何實現這一目標嗎?
注意:我只想檢查 outlook 中的傳入電子郵件發件人是否是有效的 lync 用戶。
您是否嘗試過對 email 地址使用“sip:xxx@xxx.com”格式 - 因為它正在查找 SIP 地址,而不是 email 地址。
MSDN 這里有一個示例: http://msdn.microsoft.com/en-us/library/hh378561.aspx
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.