Why are you using SoftwareSerial on the Mega, when you have three unused hardware serial ports?
Why are you trying to read data without seeing if there is anything available() to read?
I used SoftwareSerial class in order to print to command "AT" in order to check to connection between the GSM and Arduino. I also used the available() , but I wanted to check why the condition with using available method didn't work (something like:
{
if(se.available()>0)
{
// do something
}
}
if I will use the HardwareSerial library, can I send AT commands to GSM?