CkEmailBundle Perl Programming Reference Documentation
CkEmailBundle
Represents a collection of Email objects.
Object Creation
$obj = new chilkat::CkEmailBundle();
Properties
# str is a CkString object (output) LastErrorHtml( str )
Error information in HTML format for the last method called.
# str is a CkString object (output) LastErrorText( str )
Error information in plain-text format for the last method called.
# str is a CkString object (output) LastErrorXml( str )
Error information in XML format for the last method called.
# Returns an integer value get_MessageCount( )
The number of emails in this bundle.
# Returns a boolean value get_Utf8( )
# b is a boolean (input) put_Utf8( b )
When set to true, all "const char *" arguments are expected to be utf-8 strings. If set to false, the "const char *" arguments are expected to be ANSI strings.
Methods
# email is a CkEmail object (input) # Returns a boolean value AddEmail( email )
Adds an email object to the bundle.
# headerFieldName is a string (input) # headerFieldValue is a string (input) # Returns a CkEmail object FindByHeader( headerFieldName, headerFieldValue )
Returns the first email having a header field matching the headerFieldName and headerFieldValue exactly (case sensitive). If no matching email is found, returns null. Returns a null reference on failure
# index is an integer (input) # Returns a CkEmail object GetEmail( 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.
IMPORTANT: This method does NOT communicate with any mail server to download the email. It simply returns the Nth email object that exists within it's in-memory collection of email objects. Returns a null reference on failure
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
# sbXml is a CkString object (output) GetXml( sbXml )
Converts the email bundle to an XML document in memory. Returns the XML document as a string. Returns 1 for success, 0 for failure.
# filename is a string (input) # Returns a boolean value LoadXml( filename )
Loads an email bundle from an XML file. Returns 1 for success, 0 for failure.
# xmlStr is a string (input) # Returns a boolean value LoadXmlString( xmlStr )
Loads an email bundle from an XML string. Returns 1 for success, 0 for failure.
# email is a CkEmail object (input) # Returns a boolean value RemoveEmail( email )
Removes an email from the bundle. This does not remove the email from the mail server. Returns 1 for success, 0 for failure.
# index is an integer (input) # Returns a boolean value RemoveEmailByIndex( index )
Removes the Nth email in a bundle. (Indexing begins at 0.) Returns 1 for success, 0 for failure.
# filename is a string (input) # Returns a boolean value SaveLastError( filename )
Saves the last error information to an XML formatted file.Returns 1 for success, 0 for failure.
# filename is a string (input) # Returns a boolean value SaveXml( 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 Returns 1 for success, 0 for failure.
# ascending is a boolean (input) SortByDate( ascending )
Sorts emails in the bundle by date.
# ascending is a boolean (input) SortByRecipient( ascending )
Sorts emails in the bundle by recipient.
# ascending is a boolean (input) SortBySender( ascending )
Sorts emails in the bundle by sender.
# ascending is a boolean (input) SortBySubject( ascending )
Sorts emails in the bundle by subject.
# Returns a string getXml( )
Converts the email bundle to an XML document in memory. Returns the XML document as a string. Returns a null on failure
# Returns a string lastErrorHtml( )
Error information in HTML format for the last method called.Returns a null on failure
# Returns a string lastErrorText( )
Error information in plain-text format for the last method called.Returns a null on failure
# Returns a string lastErrorXml( )
Error information in XML format for the last method called.Returns a null on failure
|