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);
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.