/// <summary>
        /// Gets the email addresses in roles.
        /// </summary>
        /// <param name="Roles">The roles.</param>
        /// <param name="portalID">The portal ID.</param>
        /// <returns>A string[] value...</returns>
        public static string[] GetEmailAddressesInRoles(string[] Roles, int portalID)
        {
            if (Config.UseSingleUserBase)
            {
                portalID = 0;
            }

            if (HttpContext.Current.User is WindowsPrincipal)
            {
                ArrayList addresses = new ArrayList();

                for (int i = 0; i < Roles.Length; i++)
                {
                    string           account = Roles[i];
                    EmailAddressList eal     = ADHelper.GetEmailAddresses(account);

                    for (int j = 0; j < eal.Count; j++)
                    {
                        if (!addresses.Contains(eal[j]))
                        {
                            addresses.Add(eal[j]);
                        }
                    }
                }
                return((string[])addresses.ToArray(typeof(string)));
            }

            else
            {
                // No roles --> no email addresses
                if (Roles.Length == 0)
                {
                    return(new string[0]);
                }
                // Build the sql select
                string[] adaptedRoles = new string[Roles.Length];

                for (int i = 0; i < Roles.Length; i++)
                {
                    adaptedRoles[i] = Roles[i].Replace("'", "''");
                }
                string delimitedRoleList = "N'" + string.Join("', N'", adaptedRoles) + "'";
                string sql = "SELECT DISTINCT rb_Users.Email " +
                             "FROM rb_UserRoles INNER JOIN " +
                             " rb_Users ON rb_UserRoles.UserID = rb_Users.UserID INNER JOIN " +
                             " rb_Roles ON rb_UserRoles.RoleID = rb_Roles.RoleID " +
                             "WHERE (rb_Users.PortalID = " + portalID.ToString() + ") " +
                             " AND (rb_Roles.RoleName IN (" + delimitedRoleList + "))";
                // Execute the sql
                EmailAddressList eal      = new EmailAddressList();
                IDataReader      myReader = DBHelper.GetDataReader(sql);

                try
                {
                    while (myReader.Read())
                    {
                        if (!myReader.IsDBNull(0))
                        {
                            try
                            {
                                string email = myReader.GetString(0);

                                if (email.Trim().Length != 0)
                                {
                                    eal.Add(email);
                                }
                            }

                            catch
                            {
                            }
                        }
                    }
                }

                finally
                {
                    myReader.Close();
                }
                // Return the result
                return((string[])eal.ToArray(typeof(string)));
            }
        }