Board index » delphi » ContentType of email attachments / Indy

ContentType of email attachments / Indy

Hi,

I'm using the INDY component library (Version 9.0.2 Beta) to write a pop3
client with Borland C++ Builder 5.
All works well, but 1 thing doesn't:
When i retrieve an email with 1 binary attachment encoded, i cannot query
the attachment encoding scheme.

I do the following in my code:

    IdPOP31->Retrieve(1, Mail);
    Mail->GenerateHeader();
    Mail->ProcessHeaders();
    Mail->MessageParts->CountParts();
    Memo1->Lines->Add(Mail->MessageParts->Items[1]->ContentType);

The Memo1 stays empty.

In my test, i'm using a test-email that looks like this:

...
...
Subject: test
Mime-Version: 1.0
Content-Type: multipart/mixed;
        boundary="=====================_14804037==_"
Status: RO

--=====================_14804037==_
Content-Type: text/plain; charset="us-ascii"; format=flowed

this is a test
--=====================_14804037==_
Content-Type: application/mac-binhex40; name="test.zip"
...
...

So i would expect
"Memo1->Lines->Add(Mail->MessageParts->Items[1]->ContentType)" to
give me "application/mac-binhex40" or just "max-binhex40"

Could someone please tell me what I am doing wrong ?
Thanks!
B. Verhallen

 

Re:ContentType of email attachments / Indy


Quote
"B. Verhallen" <bverh...@wxs.nl> wrote in message news:3bf43238_2@dnews...
> I'm using the INDY component library (Version 9.0.2 Beta) > client
> with Borland C++ Builder 5...
> When i retrieve an email with 1 binary attachment encoded,
> i cannot query the attachment encoding scheme.
> I do the following in my code:
>     IdPOP31->Retrieve(1, Mail);
>     Mail->GenerateHeader();
>     Mail->ProcessHeaders();
>     Mail->MessageParts->CountParts();
>     Memo1->Lines->Add(Mail->MessageParts->Items[1]->ContentType);
> So i would expect
> "Memo1->Lines->Add(Mail->MessageParts->Items[1]->ContentType)" to
> give me "application/mac-binhex40" or just "max-binhex40"

You should not have to generate headers, process headers, and count parts on
mail receipt.  Those are already performed, or not needed.  Just do the
following:

    IdPOP31->Retrieve(1, Mail);
    Memo1->Lines->Add(Mail->MessageParts->Items[1]->ContentType);

hth...

Re:ContentType of email attachments / Indy


"Don Siders - Team Indy" <side...@att.net> wrote in message
news:3bf45e81$1_2@dnews...

Quote
> You should not have to generate headers, process headers, and count parts
on
> mail receipt.  Those are already performed, or not needed.  Just do the
> following:

>     IdPOP31->Retrieve(1, Mail);
>     Memo1->Lines->Add(Mail->MessageParts->Items[1]->ContentType);

> hth...

I tried to do that, but that just gives me an empty string....
I'm using Eudora's qpopper for pop3 server. Could that be the cause of this
?
Or could it be a bug in Indy 9.0.2 Beta ?

B. Verhallen

Other Threads