How do I convert a comma delimeted string of email addresses to an array of recipients for a message?

Travis Polland

Use the InternetAddress.parse() method:

  String strName = /* request.getParameter("TO"); */
  InternetAddress[] address = InternetAddress.parse(strName);
  message.setRecipients(Message.RecipientType.TO, address);
About | Sitemap | Contact