◈ Mail → Excel

Export Gmail emails to Excel

By the Mail → Excel team · Updated 2026-10-20

Connection settings, credentials and the limits that break exports — for Gmail.

Connection settings

SettingValue
IMAP hostimap.gmail.com
Port993
EncryptionSSL/TLS
Accessread-only

Credentials

  1. 1. Enable 2-Step Verification
  2. 2. Create an App Password for Mail
  3. 3. Use the 16-character password with imap.gmail.com:993 SSL

Limits to expect

Export command

python mail_to_excel.py --host imap.gmail.com --port 993 --user you@example.com --days 31 --out mail.xlsx

Next step

The universal IMAP guide · Exports by role · Ready script ($3)

FAQ

Why does my normal password fail?

Google blocks basic auth for IMAP; you need an app password or OAuth.

How do I avoid duplicate rows?

Export a single label instead of All Mail.

Related guides