Writing Messages to Thunderbird MBOX Files

Contents
[ ]

If you need to programmatically add new messages to a Thunderbird mail storage file, Aspose.Email provides the MboxrdStorageWriter class to simplify this task. This class allows you to write messages to an existing MBOX file.

The steps below outline how to use the MboxrdStorageWriter along with the MailMessage class to create and store messages in Thunderbird’s mail format. A code sample is also provided to demonstrate the process.

  1. Open the Thunderbird storage file in FileStream.
  2. Create an instance of the MboxrdStorageWriter class and pass the above stream to the constructor.
  3. Prepare a new message using the MailMessage class.
  4. Call the write_message() method and pass the above MailMessage instance to add the message to Thunderbird storage.
  5. Close all streams.