The suggested solution is to use OAuth authentication, then you can get the email address from the OAuth token.
In case of authenticating using network credentials, the EWS protocol offers the ResolveNames() method. It should be suitable to achieve your needs. It can be used like this:
string username = "YOUR_USERNAME_HERE";
string email = "";
var names = client.ResolveNames(username);
foreach (var n in names)
{
if (username.Equals(n.Name, StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(n.EmailAddress))
{
email = n.EmailAddress;
break;
}
}
Console.WriteLine("{0}: {1}", username, email);
If this approach does not work for you, investigate complete server response (the names
collection) and maybe you spot something useful for you.