Implementing this like Gmail would mean doing it server-side. Handling it in the client would be more error-prone, since your device would have to have a good connection in the future, and if it doesn’t, handle retries and make sure never to double-post.
Found the Slashdotter.