Sitecore security is based on the ASP.NET security model. Therefore, you can use the standard ASP.NET API to get users of a specific role:
var users = System.Web.Security.Roles.GetUsersInRole("yourdomain\yourrole");
And later, repeat the search for found users and read the email property:
foreach (var user in users)
{
var membershipUser = System.Web.Security.Membership.GetUser(user);
var email = membershipUser.Email;
}
I may be mistaken in the details of the syntax, but I am sure that you can understand this by knowing the general idea.
source
share