Once you have a Message object (in their example, this is βmessage [0]β, since they have an array of messages), you can do something like
List<String> toAddresses = new ArrayList<String>(); Address[] recipients = message.getRecipients(Message.RecipientType.TO); for (Address address : recipients) { toAddresses.add(address.toString()); }
source share