two changes. First the script no longer attempts to send mail to practice users
Secondly if it encounters a bad email address, it does not just quit as before
(without sending remaining messages) rather it goes on sending all messages
and at the end lists all students for whom no message was sent.