Send a text message to the specified recipient. Optionally, sends can be scheduled.
See also What is a sent message?
With the minimum arguments required, sends 'my message' to 447000000000 with sender ID 'Sender':
| Code Block | ||||||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
Hashtable<String, String> result = tmClient.sendSMS("My message", "447000000000", "Sender", 72, "", "", null);
System.out.println("Used " + result.get("credits_used") + " Credits, ID: " + result.get("message_id") + ", Status: " + result.get("status"));
|
As above, but sets validity to 72 hours and is scheduled for sending on 1st Jan 2013 at 01:00 GMT:
| Code Block | ||||||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
Calendar cal_end = Calendar.getInstance();
cal_end.set(2013, 1, 1, 1, 0, 0);
Hashtable<String, String> result = tmClient.sendSMS("My message", "447000000000", "Sender", 72, "", "myTag", cal.getTime());
System.out.println("Used " + result.get("credits_used") + " Credits, Scheduled ID: " + result.get("scheduled_id") + ", Status: " + result.get("status"));
|