[英]How do I get the email address of the author of a SharePoint list item?
As title says, I have access to the current listitem - and it's easy enough to get the author/created by name - but how do I retrieve the e-mail address of the author in C# from the object model? 正如标题所说,我可以访问当前的列表项 - 并且很容易通过名称获取作者/创建 - 但是如何从对象模型中检索C#中作者的电子邮件地址?
Thanks. 谢谢。
You can get the SPUser from a SPFieldUserValue object: 您可以从SPFieldUserValue对象获取SPUser :
SPFieldUserValue userValue =
new SPFieldUserValue(web, item[SPBuiltInFieldId.Author].ToString());
SPUser user = userValue.User;
string email = user.Email;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.