When SMS is sent from a email address, Email Gateway server sends a string containing from address, message text. Current code is treating the first word as from_address, second word as subject and rest of the string as message_body. Because of this second word is getting stored in separate variable and not as part of message text, so second word is always lost.