well, the first one is easy, you just have to insert a new row into the privatemessage table, you should be able to do so..
the scond one should be as easy to you need a while construct:
PHP Code:
$users=$DB_site->query("SELECT userid FROM user WHERE usergroupid=XXX");
while($user=$DB_site->fetch_array($users)) {
$DB_site->query("INSERT INTO privatemessage.......");
}