For the email, you can send the email with all those addresses in the BCC field. Check out javax.mail.Message#addRecipient(s). The maximum number of addresses on the BCC list depends on the mail server. If you can't send everything in one go, send out a few emails instead:
Because you're using BCC you will not show all the email addresses to all recipients, and that will decrease the chance that those addresses end up on some spam list.
You will probably need a CC or TO address as well, but you can use your own address for that.
I don't know how to send SMS messages with
Java but the principle is the same. You may have to send those one at a time in a loop instead of grouping numbers together like the BCC solution.