I have been the full time sysadmin responsible for the mail server. I have had the job of keeping the mail service up. It's not cheap. You need redundant networking, redundant servers, redundant storage, redundant staff, and the glue to make sure it all works. For anyone spending less than a couple hundred thousand a year on IT, it's damn near impossible to beat Google's uptime for hosted mail.
As for your other concern about getting the data out of Gmail - you use the same protocols the rest of the Internet uses - IMAP/POP and SMTP. Not rocket science.
Hi Boss -
I'm the guy that switched our email service to Google. See, it only costs us $50/year/user and this has been the first outage in over year. We used to pay a full time sysadmin to manage the mail server and would average about 12-20 hours of total downtime per year (maintenance, outages, etc.).
Obviously, the switch to Google has been much better for the corporate bottom line. Not to mention that we also get calendaring, wiki/sites, docs, and chat for the same price.
Ah, I'm glad you understand. You have a nice evening too.
Can you beat Google's uptime? I doubt it. Sure, it's not impossible, but you won't be doing it for less than $50/user?
I've noticed several design suggestions in your code.