MboxStorageReader
Contents
[
Hide
]MboxStorageReader class
Represents an MBOX file and provides methods for reading and extracting messages. The MBOX file format is used for storing a collection of email messages.
The following code provided is intended for processing email messages stored in an MBOX file using the MboxStorageReader class.
// Create an instance of the MboxStorageReader using the factory method 'CreateReader'.
var mbox = MboxStorageReader.CreateReader("storage.mbox", new MboxLoadOptions());
// Iterate through each message info object in the mbox storage.
foreach (var mboxMessageInfo in mbox.EnumerateMessageInfo())
{
Console.WriteLine($"Subject: {mboxMessageInfo.Subject}");
Console.WriteLine($"From: {mboxMessageInfo.From}");
Console.WriteLine($"To: {mboxMessageInfo.To}");
// Extract the full MIME message object from the MBOX storage using the message's unique entry ID.
var eml = mbox.ExtractMessage(mboxMessageInfo.EntryId, new EmlLoadOptions());
// Save the extracted MIME message as an .eml file.
eml.Save($"{eml.Subject}.eml");
}
' Create an instance of the MboxStorageReader using the factory method 'CreateReader'.
Dim mbox As MboxStorageReader = MboxStorageReader.CreateReader("storage.mbox", New MboxLoadOptions())
' Iterate through each message info object in the mbox storage.
For Each mboxMessageInfo As var In mbox.EnumerateMessageInfo()
Console.WriteLine($"Subject: {mboxMessageInfo.Subject}")
Console.WriteLine($"From: {mboxMessageInfo.From}")
Console.WriteLine($"To: {mboxMessageInfo.To}")
' Extract the full MIME message object from the MBOX storage using the message's unique entry ID.
Dim eml As var = mbox.ExtractMessage(mboxMessageInfo.EntryId, New EmlLoadOptions())
' Save the extracted MIME message as an .eml file.
eml.Save($"{eml.Subject}.eml")
Next
Constructors
| Name | Description |
|---|---|
| MboxStorageReader (2 overloads) | Initializes a new instance of the MboxStorageReader class. |
Methods
| Name | Description |
|---|---|
| ByteArrayStartsFromMarker | Checks whether the array starts from given marker. |
| Cancel | This method used to interrupt a split operation. |
| ContainsAsctime | Determines whether the specified line contains asctime string. |
| CreateReader (2 overloads) | Creates the instance of reader. |
| Dispose (2 overloads) | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
| EnumerateMessageInfo (3 overloads) | Exposes the enumerator, which supports an iteration of messages in storage. |
| EnumerateMessages (6 overloads) | Exposes the enumerator, which supports an iteration of messages in storage. |
| ExtractMessage | Get the message from MBOX. |
| get_BaseStream | Gets the base stream. |
| get_CurrentDataSize | Gets the number of bytes that is read by ReadNextMessage method. |
| GetTotalItemsCount | Returns the number of messages in a storage. |
| GetVentureLicenseState | |
| NextMessage (2 overloads) | Gets the next message info. |
| ReadLine | Reads the line from stream. |
| ReadNextMessage (5 overloads) | Reads the next message from underlying storage stream. |
| set_CurrentDataSize | Gets the number of bytes that is read by ReadNextMessage method. |
| SetPositionByIndex | Implemented in Aspose::Email::Storage::Mbox::MboxrdStorageReader , and Aspose::Email::Storage::Mbox::MboxoStorageReader . |
| SplitInto (2 overloads) | Splits the mbox storage into less sized parts. |
| MboxoStorageReader | |
| MboxrdStorageReader | |
| EmlCopied | Event that occurs after successful copy of a MailMessage object within the SplitInto(long, string) method. |
| EmlCopying | Event that occurs before the MailMessage object copy process, within the SplitInto(long, string) method. |
| EmptyFromMarkerCR | |
| EmptyFromMarkerCRLF | |
| EmptyFromMarkerLF | |
| FromMarker | “From " signature, indicates a start of the message. |
| MboxFileCreated | Event that occurs when a new MBOX file is created during the SplitInto(long, string) method. |
| MboxFileFilled | Event that occurs after filling an MBOX file with data within the SplitInto(long, string) method. |
| MboxoMarker | The mbox format uses a single blank line followed by the string ‘From ’ (with a space) to delimit messages. In mboxo format sender’s email address in message delimiter is replaced by the constant string ‘???@???’, i.e. ‘From ???@???’ |
| msgCount | |
| mVentureLicense | |
| preferredTextEncoding |