Send Mail to multiple Recipients in java

后端 未结 12 753
孤城傲影
孤城傲影 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条回答
  •  难免孤独
    2020-12-02 09:06

    You can have multiple addresses separated by comma

    if (cc.indexOf(',') > 0)
        message.setRecipients(Message.RecipientType.CC, InternetAddress.parse(cc));   
    else
        message.setRecipient(Message.RecipientType.CC, new InternetAddress(cc));
    

提交回复
热议问题