SIM800 is a quad-band GSM/GPRS module that works on frequencies GSM 850MHz, EGSM 900MHz, DCS 1800MHz and PCS 1900MHz. SIM800 features GPRS multi-slot class 12/ class 10 (optional) and supports the GPRS coding schemes CS-1, CS-2, CS-3 and CS-4. The development board supports mobile Unicom 2g / 3g / 4g card.DC6-24v wide voltage power supply, can also conveniently used in conjunction with your system power. Board high performance DC-DC power supply circuit, plus TVS protection, the system is greatly enhanced stability.
In this code first we include all the libraries. Then we declare all the variable and initialize GSM and Serial. After that we Send AT command to GSM to receive any new message. When a message is received we read each byte and add it to a String. After that will use subString to extract Message. If message is contain “X” in between two @ than will send SMS contain String which was in between the two @.