GSMSerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
GSMSerial.println(sendto);
delay(1000);
GSMSerial.println(link);// The SMS text you want to send
delay(100);
GSMSerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
Serial.println("SMS is Sended");
}
here I need to send SMS, to the SMS received phone number instead of mentioning it within the code level. (+9**).
If anyone can, please help me on resolving this. Thank you!
Below is the function which validating sms
void ValidateSMS(String SMS) { String number = "+CMT:"; int index1 = SMS.indexOf(number); if (index1 == -1) { Serial.println("An Error Occured Durring reading sms"); } else { Serial.println("it is a sms"); int index2 = SMS.indexOf(number);
} }
Below is the function which sending sms.
void SendSMS() { String sendto = "AT+CMGS=\"+96*****\"\r";
GSMSerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode delay(1000); // Delay of 1000 milli seconds or 1 second GSMSerial.println(sendto); delay(1000); GSMSerial.println(link);// The SMS text you want to send delay(100); GSMSerial.println((char)26);// ASCII code of CTRL+Z delay(1000); Serial.println("SMS is Sended"); }
here I need to send SMS, to the SMS received phone number instead of mentioning it within the code level. (+9**).
If anyone can, please help me on resolving this. Thank you!