Tuesday, 17 December 2013

Get Current User Email by sharepoint 2013 Object Model


Hi,


   Here we will write sharepoint 2013 object model code to retrieve current user email id. 
Use the following code.

string strUserName = HttpContext.Current.User.Identity.Name.ToString();

string strEmail = SPContext.Current.Web.AllUsers[strUserName].Email;

First we will retrieve the user name and then we will retrieve the email id.

No comments:

Post a Comment