Until recently you accessed your Gmail account from your phone using POP. So either you were deleting mail off the server you weren’t ready to delete or you had to delete all your emails on the server then again on your phone. IMAP changes that. IMAP keeps your phone and Gmail account in sync.
First switch your Gmail account from POP to IMAP
1) log onto your Gmail account
2) go to settings -> forward and POP/IMAP
3) at the bottom select ‘Enable IMAP
Then Delete the current Gmail setup on your phone and re-set it up:
1) Open the Start menu and select Programs — Messaging — New E-mail Account.
2) Enter your Gmail username (including ‘@gmail.com’) in the E-mail Address field.
3) Uncheck the box to get settings automatically from the Internet and select Next.
4) Select Internet e-mail as your email provider in the drop-down menu.
5) Enter your name as you want it to appear in sent emails.
6) Enter a descriptive name for the email account and select Next.
7) Enter imap.gmail.com in the Incoming Mail Server field.
8 ) Select IMAP4 as the Account type from the drop-down menu and select Next.
9) Enter your Gmail username (including ‘@gmail.com’) and password.
10) Select Next.
11) Enter smtp.gmail.com in the Outgoing (SMTP) Mail Server field.
12) Make sure that the Outgoing server requires authentication box is checked.
13) Select the Advanced Server Settings link.
14) Make sure that the Require SSL box is checked for both incoming and outgoing emails.
15) Select The Internet as the network connection from the drop-down menu.
16) Select Done and then select Next.
17) Select how often you want your phone to send/receive emails from the drop-down menu.
18 )For more download options, select the Review all download settings link.
19 )Select Finish.