I want to develop a simple app that enables me to send SMS to several numbers and from several numbers.
In the code below, I send from number 5555 to 6666. I want to send, for example, also from number 7777 to number 8888.
What do I need to add to the code?
Meanwhile, I tried to copy TextMessage
message but without success.
package getstarted;
import com.nexmo.client.NexmoClient;
import com.nexmo.client.auth.AuthMethod;
import com.nexmo.client.auth.TokenAuthMethod;
import com.nexmo.client.sms.SmsSubmissionResult;
import com.nexmo.client.sms.messages.TextMessage;
public class SendSMS {
public static void main(String[] args) throws Exception {
AuthMethod auth = new TokenAuthMethod("xxxxx","yyyy");
NexmoClient client = new NexmoClient(auth);
TextMessage message = new TextMessage("5555", "6666", "Hello from Nexmo!");
SmsSubmissionResult[] responses = client.getSmsClient().submitMessage(message);
for (SmsSubmissionResult response : responses) {
System.out.println(response);
}
}
}