Re: trouble with reading mail attachments

Giganews Newsgroups
Subject: Re: trouble with reading mail attachments
Posted by:  Craig (cra…@bazzltd.com)
Date: Thu, 25 Sep 2003

First, update indy to the latest dev snapshot, 9.14 i think and im not sure
if the SaveToFile() problem has been fixed with the dev snapshots but i do
know a way of bypassing that issue with the older versions on indy if you
insist on not updating.

var
  iMsg: TidMessage;

begin
//blah
  iMsg.NoDecode := True; //add this line before recieving the msg
  iPop.Retrieve(iMsg,0);
  iMsg.SaveToFile('c:\mymsg.eml');
  //msg will be saved in an umodified format
  iMsg.Clear;
  iMsg.NoDecode := False;
  iMsg.LoadFromFile('c:\mymsg.eml');
  //now you will have access to all the headers etc;
//what ever else
end;

Regards

Craig.

"Daniel Goldstein" <dgoldste…@despegar.com> wrote in message
news:815413CBF97FE240dgoldste…@despegar.com...
> Hi,
>
> We are having trouble in reading mails that include attachments and were
> sent by a MS Exchange server.
>
> When we retrieve the message in debug time, the length of receiveHeaders
is
> 0.  So, just like commented in the source code, it will try to do the
> retrieve with the method ReceiveBody of the class TIdMessageClient.
>
> After modifying the the code we were able to read the body of the
messages.
> However, the attachments are read and acknowledged, but after the
SaveToFile
> the attachment file seems corrupted -it cannot be opened with the
> corresponding application.  We are using version 9.04 of the Indy
libraries.
>
> I will appreciate any help very much.
>
> Regards,
>
> Daniel

Replies

None

In response to

trouble with reading mail attachments posted by Daniel Goldstein on Tue, 23 Sep 2003