Gboard 800 (SIM900 + ATmega 328)
The SimpleWriteln() function just sends an instruction. It doesn't return anything.  Once you have sent the instruction to retrieve the IMEI you then have to actually read the IMEI.

However, fortunately, there is a function that does it for you:

char imei[20];
gsm.getIMEI(imei);


The IMEI should now be in the C string imei. What you do with it then is up to you.