Sending SMS message vis GPRS SIM900A with Arduino UNO is not reliable

May be posting the code for printSerial() as requested?
you could also increase the timeout (change 20000UL but that's already 20s so...)
of course there is the possibility of Software Serial / altSerial to miss a beat depending on baud rate used... which we don't know about...

Don't post snippets (Snippets R Us!)