Originally posted by vijayinukollu:
Hi,
so how to make this dynamic increment of the email address to the "toAddress" piece which you specified in you'r code ?
Thanks
Mohan
A general answer; put it into an ArrayList which has a dynamic size but not the same overhead as a Vector, convert it to an array if you wish, and iterate through it one way or another, sending to each address. The InternetAddress Class also has a public static InternetAddress[] parse(String addressList) method that converts a comma separated string of addresses into an array of InternetAddress objects.
Appearantly there is a setRecipients method that takes an array of Address instead of a single Address which is a variation of the method that I believe greg was suggesting.