$query = $this->modx->newQuery('modUser');
$users = $this->modx->getCollection('modUser', $query);
foreach($users as $i => $user) {
$id = $user->id;
if ( $user->isMember('Administrator') ) {
$profile = $user->getOne('Profile');
$email = $profile->get('email');
if ( !is_null($email) ) {
$mail->address('to', $email);
}
}
}