TIDPOP3Server attachment problem

Giganews Newsgroups
Subject: TIDPOP3Server attachment problem
Posted by:  Philip Taylor (philly_t…@hotmail.com)
Date: Thu, 28 Aug 2003

Hi,

I have a program that downloads mail from a pop3 server (ISP), stores them
on disk as IDMessages, then passes them on to outlook express when it
connects to the IDPOP3Server.

Everything seems to work fine, except that OE does not pick up that an
e-mail has an attachment. The message source of the e-mail appears to
contain the attachment, howver:

--=_NextPart_2rfkindysadvnqw3nerasdf
Content-Type: image/jpeg; name="31.jpg";
        name="31.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="31.jpg";
        filename="31.jpg"

/9j/4AAQSkZJRgABAgA... etc.

My question is, how do i pass the e-mails onto OE so that the attachment
will be 'detected'?
Heres me code as it stands:

//client
procedure TForm1.Button1Click(Sender: TObject);
var
    i : integer;
begin
    idpop31.Connect(10000);
    messagesonserver := idpop31.Checkmessages; // get total messages on ISP

    if messagesonserver > 0 then  // if there are messages
    begin
        for i := 1 to messagesonserver do
        begin
            IDPop31.Retrieve(i, IDMessage1); // download message, store in
idmessage1
            IDMessage1.SaveToFile(inttostr(messagecount) + '.mail', false);
// save message to disk
            // Store filename of message for later retrieval
            Messages.Append(inttostr(messagecount) + '.ppsf,' +
inttostr(IDMessage1.InstanceSize));
            inc(messagecount); // Add one to number of messages in database
        end;
    end;
    idpop31.Disconnect;
end;

//server
procedure TForm1.IdPOP3Server1RETR(ASender: TIdCommand;
  AMessageNum: Integer);
var
    aStringList : TStringlist;
begin

// <<<<<<<<<<  HERES WHERE I GET STUCK >>>>>>>>>>>

    aStringList := Tstringlist.Create; // create stringlist
    aStringList .LoadFromFile(inttostr(AMessageNum - 1) + '.mail'); // load
IDMessage into stringlist
    ASender.Response.Add('+OK ' + inttostr(sizeof(aStringList )) + '
octets'); // send msg num and size
    Asender.Response.AddStrings(aStringList ); // send message
    FreeandNil(aStringList ); // free stringlist
end;

Thanks for your help,

Philip

Replies