*/
public class SendSmsMtForASet {
public static void main(String[] args) {
try {
MchoiceAventuraSmsSender sender = new MchoiceAventuraSmsSender(new URL("http://127.0.0.1:65182"), "PD_ET_e0550",
"098f6bcd4621d373cade4e832627b4f6");
// send message to a multiple destination
String message;
String[] addresses;
if (args.length >= 2) {
// Use message and destination from command line
message = args[0];
addresses = new String[args.length - 1];
for (int i = 1; i < args.length; i++) {
addresses[i - 1] = args[i];
}
} else {
// Use default message and destinations
message = "test message";
addresses = new String[3];
addresses[0] = "+94969696969";
addresses[1] = "+94969696968";
addresses[2] = "+94969696967";
}
System.out.println("Start sending sms message[" + message + "] to addresses[" + Arrays.toString(addresses)
+ "]");
MchoiceAventuraResponse response = sender.sendMessage(message, addresses);
if (response.isSuccess()) {
System.out.println("Message [" + message + "] sent successfully to all addresses.");
} else {
System.out.println("Failed to send message due to [" + response.getStatusCode() + "]["