Can we have a link to the SIM900 shield / board that you are using please?
I'm assuming that you are using the popular one, and based on that how long does it take the net led to indicate that it has a signal? Try it a few times to get an average and then put a delay after the Serial.begin command. If you run the sketch as is then it doesn't give the SIM900 time to acquire a network lock before trying to send the message.