4

How to send a SMS to many recipients in android? I want to send a SMS to many receivers in my application. I know this code:

Uri smsToUri = Uri.parse("smsto:" + 10086);
                Intent intent = new Intent(
                        android.content.Intent.ACTION_SENDTO, smsToUri);
                String message = "hello";
                // message = message.replace("%s", StoresMessage.m_storeName);
                intent.putExtra("sms_body", message);
                startActivity(intent); 

This work for single recipient. But How to send the message to many recipients by using "ACTION_SENDTO" intent? That is too say, how to call the third-party application to send a SMS to many recipients in phone?

Judy
  • 1,772
  • 6
  • 27
  • 48

1 Answers1

9

send sms to multiple numbers:

String strnum="10086;10086;10087;10089";
Uri smsToUri = Uri.parse("smsto:" + strnum);

or for Sending SMS to Multiple numbers using SmsManager see this post

Unable to send sms using SmsManager in Android

Community
  • 1
  • 1
ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
  • Thank you for reply. I test this method in Sumsung GAlaxy S2, the result is OK. But it can't work at HTC HD. If change the "," to ";", it also can work in HTC HD. Is there any common method which can run in any device? Or I need to detect the brand of the device to using the different separation? – Judy Jun 24 '12 at 09:39
  • 1)When I use ";", it's not working on Sumsung GAlaxy S2 but working on HTC HD. 2)When I use ",", it's working on Sumsung Galaxy S2 but not working on HTC HD. – Judy Jun 24 '12 at 09:48
  • which android version currently ruining on HTC HD? – ρяσѕρєя K Jun 24 '12 at 09:50
  • The android version of HTC HD is 2.3.5. I get this information from "Setting" in HTC HD device. And the android version of Sumsung Galaxy S2 is 4.0.3 – Judy Jun 24 '12 at 09:54
  • @Judy : but my answer is according to your question.if you have any device related problem then i think first find Manufacture Name or Android Version before sending SMS. – ρяσѕρєя K Jun 24 '12 at 09:55
  • @Judy This seems to be a known issue with Samsung devices. See http://stackoverflow.com/a/9722290/1139908 for a snippet to detect Samsung phones. – karl Feb 14 '13 at 18:09