(GSM) send sms to 2 or 3 recipient

Good day! is it possible to send sms to multiple recipient using AT Command. How? Thanks.

Use a for() loop? Have the recipient numbers in an array, and use the loop counter to determine which number to send to.

Thank you for your reply.. Im kinda new in programming.. Can you give me example codes?

Thank you.

Something along the lines of:

#include <SoftwareSerial.h>

SoftwareSerial SIM900(7, 8);

String recipientNumber[2];

recipientNumber[0]="+447751123456";
recipientNumber[1]="+447751123457";

void setup()
{
  //Initialise here
}

void loop()
{
   for (int i=0;i<2;i++)
   {
      SIM900.println("AT + CMGS = \"" + recipientNumber[i] +"\"");
      // etc.. etc..
   }
}

I don’t have the IDE at work so not compiled and untested. But it should give you the basic idea.

thank you dana :)

I will try it.

Ahmmm ... I have a question what code will I put in void setup that says "Initialise here"??

The code to initialise your modem? And any peripherals attached to the project?

ok thanks again dana :)

dannable:
Something along the lines of:

#include <SoftwareSerial.h>

SoftwareSerial SIM900(7, 8);

String recipientNumber[2];

recipientNumber[0]="+447751123456";
recipientNumber[1]="+447751123457";

void setup()
{
  //Initialise here
}

void loop()
{
  for (int i=0;i<2;i++)
  {
      SIM900.println(“AT + CMGS = “” + recipientNumber[i] +”"");
      // etc… etc…
  }
}




I don't have the IDE at work so not compiled and untested. But it should give you the basic idea.

Its not working, can you please post complete code.
Thanks in advance