◈ Mail → Excel

Export Microsoft 365 emails to Excel

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

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

Connection settings

SettingValue
IMAP hostoutlook.office365.com
Port993
EncryptionSSL/TLS
Accessread-only

Credentials

  1. 1. Request OAuth app registration from IT
  2. 2. Or export from Outlook desktop to PST
  3. 3. For IMAP, confirm basic auth is still allowed for the tenant

Limits to expect

Export command

python mail_to_excel.py --host outlook.office365.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

IMAP is blocked by policy

Use the desktop export or Graph API with admin consent.

Will admins see the export?

Yes, scripted access is usually logged; get approval first.

Related guides