AnsweredAssumed Answered

Sending an email to multiple recipients using Java Mail

Question asked by limlayhong on Sep 26, 2013
Latest reply on Sep 27, 2013 by William_W
I want to send message to multiple Recipients using JAVA mail, can anyone please provide me the snippet that i can work around ? Thanks.
<!-- Add TO recipients -->
<core:new className="javax.mail.internet.InternetAddress" var="recipientsTO">
  <core:arg type="java.lang.String" value="me@mycompany.com" />
</core:new>

<!-- Send email message -->
<core:new className="javax.mail.internet.MimeMessage" var="message">
  <core:arg type="javax.mail.Session" value="${mailSession}" />
</core:new>
<core:set value="${mailSession.setDebug(debug)}" var="void" />
<core:set value="${message.setFrom(sender)}" var="void" />
<core:set value="${message.setRecipient(recipientTypeTO, recipientsTO)}" var="void" />
<core:set value="${message.setSubject(subject)}" var="void" />
<core:set value="${message.setContent(multiPart)}" var="void" />
<core:set value="${mailSession.getTransport()}" var="transport" />
<core:set value="${transport.connect()}" var="void" />

Outcomes