Archived Forum Post

Index of archived forum posts

Question:

GetMime only gives header

Aug 24 '15 at 08:56

Hi,

I'm using the Chilkat library via declares in Xojo. Getting the headers for a mail works okay, but the function GetMime only gives me the headers, too.

Declare for Header: Declare Function getHeaderData lib ImapLibLocation selector "Header" (obj as Ptr) as CFStringRef Return getHeaderData(self)

Declare for Body: Declare Function getBodyData lib ImapLibLocation selector "GetMime" (obj as Ptr) as CFStringRef Return getBodyData(self)

Is this a bug? I'm using version 9.5.0.48 of the library.

Regards

Beatrix Willius


Answer

Check to see if you downloaded headers-only.


Answer

Thanks! I think I've got it: In the code below I'm using FetchHeaders, which is obviously not a good idea. So I'd better use FetchSequenceAsMime or FetchSingleAsMime.

'get pointer to MessageSet declare Function searchAll lib ImapLibLocation selector "Search:bUid:" (obj as Ptr, refname as CFStringRef, fetchUuids as Boolean) as Ptr dim p as Ptr = searchAll(self, "ALL", true) dim MessageSetPointer as Ptr = searchAll(self, "NOT DELETED", doTrash) if MessageSetPointer = nil then globals.theErrorLog.LogItem CurrentMethodName + " messagesetpointer is nil " + getLastErrorCko globals.theErrorLog.DialogErrorProceed theError Return 0 end if MessageSet = new MessageSetCko(MessageSetPointer, False)

'now make bundle from MessageSet declare Function getBundle lib ImapLibLocation selector "FetchHeaders:" (obj as Ptr, set as Ptr) as Ptr dim EmailBundlePointer as Ptr = getBundle(self, MessageSet) EmailBundle = new EmailBundleCko(EmailBundlePointer, False) if EmailBundle = nil then globals.theErrorLog.LogItem CurrentMethodName + " EmailBundle is nil " + getLastErrorCko globals.theErrorLog.DialogErrorProceed theError Return 0 end if

NoOfMails = EmailBundle.getCount

Return NoOfMails

Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com Mail Archiver X: The email archiving solution for professionals