How to send sms

Hello everyone. This is my first arduino project. I have tried all the ways but none of them work. I have even tried the code given in example for sending a sms using gsm module. The version of my module is M590. Mostcommon error is mySerial was not declared in this scope. Thank you for your help.

(deleted)

Posting your code and a wiring diagram/picture would be very useful. When you post your code make sure to use code tags so that it is easy for everyone to read.

/*

  • this is a programme written for geting a persons location using gprs.
    */
    //initialize the pin on arduino on which the gprs will be connected for transmission and recieving
    #include <SoftwareSerial.h>
    #include<GSM.h>
    #define PINNUMBER "";
    int trans = 10;
    int reciev = 11;
    // setup the programme to begin when the button is pressed
    void setup() {
    Serial.begin(9600);
    pinMode(trans,INPUT);
    pinMode(reciev,OUTPUT);
    Serial.begin(9600);//This opens up communications to the Serial monitor in the Arduino IDE
    }
    // SETUP THE LOOP
    void loop()
    {
    if(Serial.available()>0)
    {
    void SendTextMessage();
    {
    mySerial.println("AT+CMGF=1"); //to print number in text mode
    delay(1000); //in miliseconds
    mySerial.println("AT+CMGS="+919717889680"\r"); //for the number to which the message has to be sent
    delay(1000); //in miliseconds
    mySerial.println("The current location is:"); //the message to be sent
    delay(1000); //the delay in miliseconds
    }
    }
    {
    else
    {
    NOTHING;
    }
    }
    }

This is the code that I have written.

spycatcher2k:
Yip - that blue wire is loose & line 54 of your code is wrong.

what blue wire are you talking about ?

futurehelperforcodes:
what blue wire are you talking about ?

That was humor because you ask a question totally without giving us context to answer.

Please fix your previous post and add the [ code ] tag around the code so that it's easier to read.also press CTRL-T in the IDE before copying the code so that is indented properly.

To your pb:

Why are you kinda trying to declare the SendTextMessage in the middle of the loop? And probably added a semicolumn at the end because the compiler was complaining?? Does this make sense to you?

void SendTextMessage();
    {
    mySerial.println("AT+CMGF=1");                //to print number in text mode
    delay(1000);                                     //in miliseconds
    mySerial.println("AT+CMGS=\"+919717889680\"\r");  //for the number to which the message has to be sent
    delay(1000);                                       //in miliseconds
    mySerial.println("The current location is:");       //the message to be sent
    delay(1000);                                         //the delay in miliseconds
    }

Besides Your problem is that you are using a myserial variable that has never been declared. You did not copy very well the example most likely...