问题
I am wondering if there is a way to set multiple targets for a message instead of sending message to multiple targets separately?
for(i = 0; i<x ; i++){
Message msg = new Message("reza@myhostMessage.Type.chat);
msg.setBody("HEY");
try {
connection.sendPacket(msg);
} catch (NotConnectedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
回答1:
Simply use MultiRecipientManager.send(XMPPConnection connection, Packet packet, List<String> to, List<String> cc, List<String> bcc)
来源:https://stackoverflow.com/questions/25503960/how-to-send-a-messag-to-multiple-recipients-in-asmack