That's easy. You can just call addRecipient
multiple times to add more recipients. Or you can pass multiple recipients to it, like this:
addRecipient("alice@example.com", "bob@example.com", "charlie@example.com");
Or you can pass an array to addRecipient
:
String[] rcpts = new String[] {"alice@example.com", "bob@example.com"};
addRecipient(rcpts);
Or you can take a List
, make an array from it, and then pass it:
List<String> rcptsList = new ArrayList<String>();
rcptsList.add("alice@example.com");
rcptsList.add("bob@example.com");
addRecipient(rcptsList.toArray(new String[rcptsList.size()]));