Send sms to a list of numbers comming from my java program? Please help me

**I want to send a text message to a list of numbers receiving from my java program. I can send a single sms, its is working perfect well. But how to send sms to many numbers at once. I have given arduino code and java code below. It works well . **
Please help me to send an sms to many numbers with java and arduino , sms should be sent at once

Arduino code

#include <SoftwareSerial.h>
#include <String.h>
SoftwareSerial mySerial(40, 41);

void setup() {

mySerial.begin(19200);
Serial.begin(9600);

}

String number;
String smsTxt;

void loop() {
if (Serial.available()>0)
{
String inData = Serial.readString();

number = inData.substring(0,13);
smsTxt = inData.substring(14,28);
}
}

void SendTextMessage()
{
mySerial.print("AT+CMGF=1\r"); //Because we want to send the SMS in text mode
delay(100);
mySerial.println("AT + CMGS = ""+number+""");//send sms message, be careful need to add a country code before the cellphone number
delay(100);
mySerial.println(""+smsTxt+"");//the content of the message
delay(100);
mySerial.println((char)26);//the ASCII code of the ctrl+z is 26
delay(100);
mySerial.println();
}

Java code (only the string sending code)

String mob = "+94771144786";
String txt = "Access denied ";

String x = " "+mob+" "+txt+" ";

serialPort.writeString(x);


That code will send the text message to one number at a time. What's wrong with that approach?

Yes. but I want to send an sms to many numbers at once and make the arduino code to send that sms to all the numbers at once. Should I use any mehtods like arrays? I don't know how to do that in arduino. please help me

but I want to send an sms to many numbers at once

You'll need to determine the AT command to do that.

Should I use any mehtods like arrays?

You'll need to send data that matches the AT command that you find.

please help me

No. Frankly, what you want to do sounds like spamming to me.

Im from sri lanka. Im an undergraduate student.. i dont have much knowledge about Arduino.. So upto this level I did by searching from internet. So Im stuck in here. I want to send sms to many numbers at the same time. how to make the AT commands? please give me with some examples
Thanks

I want to send sms to many numbers at the same time.

So, YOU do the research.

Im from sri lanka. Im an undergraduate student.

So?

please give me with some examples

Is NO! too difficult a concept for a undergraduate student to understand?

Im asking how to send a text message to list of numbers one by one ? please understand my question and help me . Do i need to write the SendTextMessage() method again and again to do that?

lets assume i want to send "Hi gud morning" to mobile numbers below
mob1
mob2
mob3
mob4

How can I do this inside arduino?

Are there anyone who can help me in this please???? :((

I expect each destination number would be stored as a text string. Get your list of destination numbers in an array. Ensure that you know how many numbers are in the array. Use a FOR loop to process each number in the array by sending an SMS to that number. You already know how to send an SMS to a number.