I'm using the IMAP C++ component to download emails from an Inbox, I can list the attached file, but when I
call SaveAttachedFile, I get:
I confirmed that get_AutoDownloadAttachments was True and I'm using FetchBundle not FetchHeaders, which is
confirmed because I can access the Message Body.
Here are the headers:
What am I doing wrong?
The information in the LastErrorText is poor, and I'm improving it as we speak.
The method will first check the email header for the presence of the ckx-imap-attach-nm-1 header. This would exist if the email was downloaded without attachments (or if it was download via some other means, such as from a POP3 server, or if it was loaded from a .eml file, etc.)
In any case, the "ckx-imap-attach-nm-1 header is not present" message is only informational, because after the header is not found, the method delves into the email object itself to see if the attachment is actually present, and if so, will return the attachment's filename.
It's probable in this case that the email doesn't actually have an attachment. See this Chilkat blog post for information about what is or isn't an attachment:
answered Oct 25 '12 at 10:44
I found all to be working fine. Here's the latest pre-release with the better logging:
This is the LastErrorText indicating success:
ChilkatLog: GetMailAttachFilename: DllDate: Oct 18 2012 UnlockPrefix: UNTTSTIMAPMAILQ Username: CK2007:Chilkat Architecture: Little Endian; 32-bit Language: Visual C++ 8.0 VerboseLogging: 0 Header field does not exist fieldName: ckx-imap-attach-nm-1 ckx-imap-attach-nm-1 header is not present or empty index: 0 filename: DJ.tab Success. --GetMailAttachFilename --ChilkatLog
The method first checks for the header, does not find it (which is OK), and then examines the email contents, finds the attachment and returns the filename.
answered Oct 25 '12 at 16:54
Ah yea sorry, wasn't concentrating!
Turns out to be a permissions error as I was trying to save the attachment in Program Files (even though I'm an admin and can manually save files there no problem?) but now that I know that I can save elsewhere.
If I had looked at the correct LastErrorTetxt earlier I wouldn't of wasted your time, although the header missing error in the GetMailAttachFilename error put me off and made me think was an error within Chilkat library, sorry about that.
answered Oct 26 '12 at 04:59