Get a list of users per role
$result = db_query('SELECT * FROM users u INNER JOIN users_roles ur ON u.uid = ur.uid WHERE ur.rid = :rid', array('rid' => 3)); $users = $result->fetchAll();
Use a placeholder to get the user's name in the mail
$email_message = t('Hello @name, a new article has been posted', array('@name' => $user->name));
Enable mail logging on Windows: http://drupal.org/node/625062#comment-4641292 Edit sites/default/settings.php and add that snippet. Look in sites/default/files/temporary for the mails, they will be logged to text files.