3

I am working on an email project using Zend Mail. I have successfully fetched all folders of Gmail with emails and attachments. But I cannot figure out how to download emails as mbox format? Do I need to use file handling to create mbox or there is an another way to download emails as mbox format?

Grokify
  • 15,092
  • 6
  • 60
  • 81

1 Answers1

2

You can use Google's Takeout for Gmail capability to download a copy of your email in MBOX format:

If you want to use the email and attachments you've already downloaded (e.g. using IMAP or POP), you can create a MBOX file by concatenating individual emails with attachments in MIME (RFC 5322) format, prefixing each message with a mbox separator line beginning with "From ". This header should be preceded by a blank line and not followed by a blank line. More information is available in RFC 4155:

Community
  • 1
  • 1
Grokify
  • 15,092
  • 6
  • 60
  • 81