none
Get email Id of a user using Login name in Dot net CSOM RRS feed

  • Question

  • Hi,

    I need to get the email id of a user using Dot net CSOM.

    All I have is his Login name "i:0#.w|fpl\mxj0"

    Please advice..

    Monday, March 6, 2017 4:06 PM

Answers

  • Hi,

    Here is the sample code for your reference.

    User user = context.Web.SiteUsers.GetByLoginName(@"contoso\usera");
                    context.Load(user);
                    context.ExecuteQuery();                
                    Console.WriteLine(user.Email);

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by Rameez_Hasan Tuesday, March 7, 2017 7:07 AM
    Tuesday, March 7, 2017 2:18 AM