Say you have an old Gmail account and you would like to transfer all the existing email messages from the old account to your new email address. The new address could be on @gmail.com, @outlook.com, Google Apps (@yourcompany.com) or anywhere else.
Gmail does include the useful Mail Fetcher utility to help you automatically transfer mails between Gmail accounts or between Gmail and Outlook accounts.
If you are however planning to transfer your existing Gmail messages to another email service that doesn’t support POP3 based importing, you can make use of a simple Google Script that will auto-forward all your old messages, one by one, to your new email address.