Automating email transfer between Gmail accounts

Hey folks, I need some coding help with a Gmail issue.

I’m trying to move all my emails from my college Gmail account to a new one. The usual POP/IMAP method isn’t working. It keeps giving me errors about invalid message sizes.

I thought about using Gmail’s forwarding feature, but it doesn’t let you do it in bulk. Filters don’t work either because you can’t filter by date or select everything.

So, I’m thinking of writing a program to do this automatically. It would:

  1. Log into my old account
  2. Find the oldest email
  3. Start a loop to:
    • Click ‘Forward’
    • Enter my new email address
    • Move to the next email

I know some C++, R, and VBA, but I’m not sure how to make code interact with web stuff. What language would be best for this? Any tips on how to get started?

Thanks for any help you can give!

Having dealt with similar email migration challenges, I’d recommend exploring Google’s Gmail API. It’s designed specifically for tasks like this and offers more robust functionality than browser automation. You’ll need to set up OAuth2 credentials and use a programming language with good API support - Python is an excellent choice here. The API allows you to efficiently fetch emails from your old account and create them in the new one, preserving metadata and attachments. Be mindful of quota limits and implement error handling to manage potential timeouts or connection issues during the transfer process. This approach should prove more reliable and faster than simulating user actions in a browser.

Based on my own experience working with Gmail transfers, I can say that Python should be your primary option for automating this task. The combination of modules like selenium to handle browser interactions and imaplib for accessing email servers makes it a strong candidate, especially when other methods have failed. I encountered similar issues when transferring a large number of emails between accounts and found that addressing rate limits by adding delays and relying on OAuth for secure authentication are essential steps. I encourage you to consider these practices while developing your solution.

hey ethan, python’s definitely ur best bet here. i’ve done similar stuff before. check out the ‘imap’ library - it’s super handy for email stuff. you’ll need to enable IMAP in ur gmail settings first tho. also, watch out for googles rate limits or they might block ya. good luck with the transfer!