I want to get email of users who are uploading documents in a library. You know there is a field called "Created By" which contain full name, so I want to read that name and then find that user's email.
Is there a way to do it without querying Active Directory?
There is another method (given below) but for it to work you need to know userid of user.
SPSite oSiteCollection = SPContext.Current.Site;
using (SPWeb oWebsite = oSiteCollection.AllWebs["Website_Name"])
{
SPUser oUser = oWebsite.AllUsers["User_Name"];
oUser.Email = " E-mail_Address";
oUser.Update();
}
What I have is full name only which is saved in "Created By" field of any library.