help writing correct code

Hello i'm new in your forum and not so good in C language programming. Can somebody help to me to write a maybe simple programfor you but not and for me.:( i want to use arduino module with gsm/gprs board. i use 4 inputs and 4 outputs from board pinouts. inputs to detect logic "0" or logic "1".When change state to logic (1) is detected, ex. led1 turn ON and send email using my own smtp server,same situation when change state to logic (0) send another email with another text and led1 goes OFF.The same thing for all 4 inputs/and 4 outputs with leds. please help me to write proper code. my begin of code is here but can't continue i hope some help.sorry for my bad EN

You use digitalRead() to determine the state of the input pins.

You use if statements to decide whether the state of the pin is not the same as the state the last time you checked.

If the state is not the same, you use a whole bunch of complicated code the send the SMS. What that code looks like depends on which GSM shield you have.