sending to multiple recipients with javamail
843830Sep 5 2005 — edited Jun 12 2007Hi 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