checking IMAP mails for an attachment

Giganews Newsgroups
Subject: checking IMAP mails for an attachment
Posted by:  Hans Peter (hanspet…@hotmail.com)
Date: Fri, 3 Mar 2006

hallo,

i want to check if an mail on an imap server
contains an attachment, but i have no idea
how to do this, i tried following but it don't works:

                TheImap.GetUID(i+1, TheUID);
                TheImap.UIDRetrieveFlags(TheUID, TheFlags);
                TheImap.UIDRetrieveHeader(TheUID, TheMsg);
                Inbox.Cells[0, i+1] := IntToStr(i+1);
                Inbox.Cells[1, i+1] := TheUID;
                if length(TheMsg.Headers.Values['X-Attachments']) > 0 then
// << got no luck with this becaus the mailheader don't have this value
                    Inbox.Cells[2, i+1] := 'yes'
                else
                    Inbox.Cells[2, i+1] := 'no';
                Inbox.Cells[3, i+1] := ' ' + LowerCase(TheMsg.Subject);

Replies