Friday, August 30, 2013

Get current user email by using SharePoint 2013 object model

Here we will write sharepoint 2013 object model code to retrieve current user email id. Also check out:

- SharePoint 2013 Boundaries and Limits

- PDF file support in SharePoint 2013

- What's new in workflow in SharePoint Server 2013?

Below is the 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.

Twitter Delicious Facebook Digg Favorites More