Re: Attachment empty..Indy 9

Giganews Newsgroups
Subject: Re: Attachment empty..Indy 9
Posted by:  xCarl (car…@pacific.net.sg)
Date: Thu, 23 Oct 2003

do you need to check for empty content before saving? sorry i am a "c" guy
and didn't fully understand your language... :p

*something like*

TIdAttachment*e =
dynamic_cast<TIdAttachment*>(Msg->MessageParts->Items[intIndex]);

            if (e!=NULL)
            e->SaveToFile(str);

"Alain" <a.mara…@astriadev.com> wrote in message
news:49B57645AE83E240a.mara…@astriadev.com...
> I receive Mail from Outlook 2000 (all patchs applied).
> The mail is
> - text
> - without Body
> - only 1 File Attachment (text).
> I Retrieve mail, find one attachment and SaveToFile, File saved is empty
(0
> ko) !!!
> If  I read with Outlook or other mailer I can save this file (2 Ko).
> If mail has a body with at least 1 character it works fine!
>
> Any Ideas ???
>
> Thanks
>
> W2000/D6/Indy 9.0.14 (component TIdPop3,TIdMessage)
>
> Program is like :
>
> POP.Retrieve(index,msg);
> ....
> for iPart := 0 to Pred(Msg.MessageParts.Count) do
> begin
>    if (Msg.MessageParts.Items[iPart] is TIdAttachment) then
>    begin
>        .....
>
TIdAttachment(Msg.MessageParts.Items[iPart]).SaveToFile(SaveDialog1.FileName
> );
>        ....
>    end;
> end;

Replies

In response to

Attachment empty..Indy 9 posted by Alain on Thu, 23 Oct 2003