|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Sending mail to exchange users using partial mail nameI have a 1.1 desktop application with a custom security table that authenticates and authorizes users based on Windows login. Recently I found the need to be able to send these users an email at certain points, and the assumption I was making originally was that the exchange name was the same as the windows name. Unfortunately, that assumption has proven false for a small group of users who have been around for a long time. These users, who were here when logins were restricted to eight characters, have exchange names longer than their windows login. For example, Bill Leiderhosen might have an exchange name of bleiderhosen but a windows name of bleiderh. When I specify a MailMessage.To value of "bleiderhosen", the email is sent successfully. When I just specify bleiderh, though, it doesn't. One commonality, though, that I've picked up on is that the first eight characters of both the windows login and the exchange name are the same. What I was hoping would happen is that I could just pass in the partial exchange name (the first eight characters), and Exchange would resolve the name correctly and send the email. What I'm seeing, though, is that this doesn't happen. Short of adding a separate field in the table for email address or creating a component to query active directory using LDAP, is there a more elegant way to use a wild card in the name, or is there a built-in framework method to resolve the name before sending it? Please advise. Thanks very much, TheManFromSql Hi,
Thanks for your post! Based on my understanding, some users in your domain will have different Windows domain account alias as the email accounts alias, so you want to find out how to obtain the email account alias from the Windows domain account alias. If I have misunderstood you, please feel free to tell me. Yes, SmtpMail class internally uses CdoNts to send the email, I do not think it supports wildcard. Also the code in this class does not automatically translate the domain account alias into exchange email alias, so I think you have to do the translation yourself. Based on my research, this kind of information is stored in AD database. If you use ADSI Edit to query the "UserAccounts" node in your domain, and view the property dialog of certain user under that node, you can view "proxyAddresses" attribute of this user account, then you will see the smtp value of the account. You may use ADSI to query this attribute value. .Net provides System.DirectoryServices for ADSI support. If you have further ADSI programming questions, there is a dedicate ADSI programming newsgroup, you may ask the ADSI question there. Hope this helps! Best regards, Jeffrey Tan Microsoft Online Community Support ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Hi,
Have you reviewed my reply in this issue? Does it make sense to you? If you have anything unclear or any concern, please feel free to let me known, thanks! Best regards, Jeffrey Tan Microsoft Online Community Support ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
|||||||||||||||||||||||