Google now has now released the IMAP service for Gmail accounts. This means that your email can actually synchronize with your iPhone instead of just pulling it down from the server. Before you would setup a Gmail account on your phone by adding an account and clicking on Gmail. If you read email on your iPhone it would still show as new in your Gmail account and vise versa. Now it is synchronized both ways and you can label your emails from the iPhone. Here are the instructions from Google. Also, be patient for the feature to become available for your account. One of my newer Gmail accounts didn’t have the feature available to activate.
UPDATE: 5thirtyone has posted an article explaining some advanced settings you should change to ensure your trash, drafts and sent mail. Here’s a snippet:
Assuming that you have followed the iPhone IMAP setup instructions, it is now time to properly configure your mobile Mail client so that Sent Mail, Deleted Mail, Drafts, and Junk are reflected properly after syncing back between the webmail client and any other desktop clients you may have.
1. Open ‘Settings’ > ‘Mail’ > [Your Gmail IMAP account] > ‘Advanced’
2. Select ‘Drafts Mailbox’ > ‘On the Server’ > ‘[Gmail] Drafts’. Return to the ‘Advanced’ view.
3. Select ‘Sent Mailbox’ > ‘On the Server’ > ‘[Gmail] Sent Mail’. Return to the ‘Advanced’ view.
4. Select ‘Deleted Mailbox’ > ‘On the Server’ > ‘[Gmail] Trash’. Return to the ‘Advanced’ view.
Any emails sent from your iPhone will appear in Gmail’s ‘Sent’ view, any saved drafts saved on your iPhone will appear in Gmail’s ‘Drafts’ view, and any deleted messages will be reflected in Gmail’s ‘Trash’ view.