Send Emails to a list of the application's users

Send Emails to a list of the application's users

Hello Everyone,

I am currently writing a script that basically needs to send an email to a specific list of users. Given the user id, is there a way to access their account email address? Right now I have:

  1. for each m in Review_Board_Member  [ID != 0]
  2. {
  3.     sendmail
  4.     (
  5.         To       :  m.User.[THIS IS WHERE I NEED HELP]
  6.         From     :  zoho.adminuserid 
  7.         Subject  :  "Sweet" 
  8.         Message  :  "This works" 
  9.     )
  10. }
Also let me know if there are other problems with this code, all it's supposed to do is fetch all records from Review_Board_member, access the user field, and then send that user an email. If there is abetter way to create a User-based email list, let me know. I'm new to this scripting language and I want to do this the most efficient way possible.

Thanks