title: Find all e-mail addresses associated with a user in active directory using C#
body: <p>I'm trying to get c# to return all e-mail addresses associated with a user in the Active Directory.  Many of our users have mutliple e-mail addresses and I need to be able to get a list of all addresses associated with a single user.  I'm using the code block below but it only returns one e-mail address.  Any help would be appreciated.</p>
  
  <pre><code>string username = "user";
  string domain = "domain";
  List&lt;string&gt; emailAddresses = new List&lt;string&gt;();
  PrincipalContext domainContext = new PrincipalContext(ContextType.Domain, domain);
  UserPrincipal user = UserPrincipal.FindByIdentity(domainContext, username);
  
  // Add the "mail" entry 
  emailAddresses.Add(user.EmailAddress);
  
  foreach (String item in emailAddresses)
  {
      DropDownList1.Items.Add(item);
  }
  </code></pre>