Send Mail to multiple Recipients in java

后端 未结 12 747
孤城傲影
孤城傲影 2020-12-02 08:23

I want to send a message to multiple Recipients using following the method :

message.addRecipient(Message.RecipientType.TO, String arg1);

<

12条回答
  •  旧时难觅i
    2020-12-02 08:49

    If you want to send as Cc using MimeMessageHelper

    List emails= new ArrayList();
    email.add("email1");
    email.add("email2");
    for (String string : emails) {
    message.addCc(string);
    }
    

    Same you can use to add multiple recipient.

提交回复
热议问题