Asking to code gsm shield

Hello, i want to asking how code send sms for 2 mobile numbers? I use gsm shield sim900. This is my code :
void fire()
{
SIM900.print("AT+CMGF=1\r"); // AT command to send SMS message
delay(100);
SIM900.println("AT + CMGS = "+6285781979032"");
delay(100);
SIM900.println("AT + CMGS = "+6285724445115"");
delay(100);
SIM900.println("WARNING!!! FIRE, FIRE"); // message to send
delay(100);
SIM900.println((char)26);
delay(100);
SIM900.println();
delay(5000); // give module time to send SMS
SIM900power(); // turn off module
SMS++;
}

can it works sir?

can it works sir?

Not that way. You need to tell it what number to send the message to, what message to send, and the end of message marker for each number you want to send the message to.

It REALLY would be a good idea to read the responses from the SIM900.

I know this isn't what you want to hear, but the SMS service is not guaranteed to deliver every message - but it's pretty good.

The best method I've found is to create a queue (an array of structs) for outgoing messages, then pop item[0] off that queue when the modem is '*ready' until there are none left.

Each message is standalone, so sending to two or twenty people requires two or twenty 'sends'... with typical coverage and network congestion, each message should take around 2-7 seconds to go out. Keep that in mind (20 messages @ 5 seconds will take over 90 seconds to clear the queue - if all goes well!)

To achieve the most reliability - check the modem responses as suggested above, and retry each send if necessary to get all the queued messages out.
A retry limit will mean that you don't get hung up on a single failed message, or the following recipients in queue will never get their alert message!

As a fire warning system, it's probably not the best solution, as during an emergency situation the cells often get crowded. It's valid as a notification to concerned recipients, but try to combine with a reliable 'alarm' that can be heard immediately and reliably. Cheers