You can construct a tmp message out side of loop, then assign the received messate to that tmp message inside loop. Now you should be able to send the tmp message from outside the loop. tmp is the last message that you received in the loop.
Why do you want to send the message from out side the loop? If you receive the message inside loop, it means could receive multiple messages. When you send the message from out side loop, now you have the last received message. rest of them will be lost. Could you tell what you r trying to do inside loop?
Siva