Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sending to multiple recipients with javamail

843830Sep 5 2005 — edited Jun 12 2007
Hi all,

Having a problem sending an email to more than one recipient.

My code section is as follows:

while(st.hasMoreTokens())
{
String nt = st.nextToken().trim();
to = new InternetAddress(nt);
message.setRecipient(Message.RecipientType.TO, to);
message.setText(body);
message.addHeaderLine("Content-Type: text/html; charset=\"iso-8859-1\"");
Transport.send(message);
}

It sends to the first email address but doesn't send to any of the others. Does anyone have any clues for me?

cheers
James
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 10 2007
Added on Sep 5 2005
6 comments
687 views