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?
Asked
Active
Viewed 194 times
1 Answers
2
You can use Google's Takeout for Gmail capability to download a copy of your email in MBOX format:
- All supported services (see "Mail"): https://takeout.google.com/settings/takeout
- Gmail: https://takeout.google.com/settings/takeout/custom/gmail
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:
- IETF RFC 4155: https://www.rfc-editor.org/rfc/rfc4155
-
Would you please add an example of creating a `MBOX` file for already downloaded email via `POP/IMAP`. – Basheer Kharoti Mar 09 '18 at 13:12