Chilkat C# EmailBundle Class Reference

EmailBundle

Represents a collection of Email objects.

Object Creation

(C#)
Chilkat.EmailBundle obj = new Chilkat.EmailBundle();
(VB.NET)
Dim obj As New Chilkat.EmailBundle()

Properties

public string LastErrorHtml {get; }

Error information in HTML format for the last method called.

public string LastErrorText {get; }

Error information in plain-text format for the last method called.

public string LastErrorXml {get; }

Error information in XML format for the last method called.

public int MessageCount {get; }

The number of emails in this bundle.

Methods

public bool AddEmail(Email email);

Adds an Email object to the bundle. Returns true if successful

public Email FindByHeader(string name, string value);

To be documented soon...

public Email GetEmail(int index);

Returns the Nth Email in the bundle. The email returned is a copy of the email in the bundle. Updating the email object returned by GetEmail has no effect on the email within the bundle. To update/replace the email in the bundle, your program should call GetEmail to get a copy, make modifications, call RemoveEmailByIndex to remove the email (passing the same index used in the call to GetEmail), and then call AddEmail to insert the new/modified email into the bundle.

Returns a null reference on failure

public StringArray GetUidls();

Returns a StringArray object containing UIDLs for all Email objects in the bundle. UIDLs are only valid for emails retrieved from POP3 servers. An email on a POP3 server has a "UIDL", an email on IMAP servers has a "UID". If the email was retrieved from an IMAP server, the UID will be accessible via the "ckx-imap-uid" header field.

Returns a null reference on failure

public string GetXml();

Converts the email bundle to an XML document in memory. Returns the XML document as a string.

Returns a null on failure

public bool LoadXml(string filename);

Loads an email bundle from an XML file.

public bool LoadXmlString(string xmlStr);

Loads an email bundle from an XML string.

public bool RemoveEmail(Email email);

Removes an email from the bundle. This does not remove the email from the mail server.

public bool RemoveEmailByIndex(int index);

Removes the Nth email in a bundle. (Indexing begins at 0.)

Returns true for success, false for failure.

public bool SaveLastError(string filename);

Saves the last error information to an XML formatted file.

public bool SaveXml(string filename);

Converts each email to XML and persists the bundle to an XML file. The email bundle can later be re-instantiated by calling MailMan.LoadXmlFile

public void SortByDate(bool ascending);

Sorts emails in the bundle by date.

public void SortByRecipient(bool ascending);

Sorts emails in the bundle by recipient.

public void SortBySender(bool ascending);

Sorts emails in the bundle by sender.

public void SortBySubject(bool ascending);

Sorts emails in the bundle by subject.