🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #5635

Re: Attachments with TIdMessage

#5635
From: Remy Lebeau (TeamB)
Date: Mon, 28 Jun 2004 01:21
42 lines
2294 bytes
"Antonio Donato" <espvida@osite.com.br> wrote in message
news:40DF591C.96CFDE8A@osite.com.br...

> the code is the following.

> Note that I did not found at Compenent Palette at
> BC++5 in which I installed Indy any icon to
> TIdAttachment

TIdAttachment is not a component to begin with, thus it does not appear in
the Component Palette.

> but there are in it Icons for TIdMessage and TIdSMTP

Those, on the other hand, ae actual components, thus they appear in the
Palette.

> Absence of TIdAttachment in Component Palette in
> BC++ is something correct or wrong?

TIdAttachment is not a component, thus you have to instantiate in code, not
visually at design-time.  I already gave you the code to do that.

> > RichEdit->PlainText=true;
> > RichEdit->Lines->SaveToFile(AnsiString(TmpFileAddress));
> > IndyMessage->Body->LoadFromFile(AnsiString(TmpFileAddress));

You could do the following instead, then you don't need the temporary file
anymore:

    IndyMessage->Body->Assign(RichEdit->Lines);

> > TIdAttachment *attachment = new TIdAttachment(IndyMessage, AttachTag);

That should be this instead:

    TIdAttachment *attachment = new TIdAttachment(IndyMessage->MessageParts,
AttachTag);


Gambit
Technical Details
Message-ID: <40df7374$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40DDCFFC.539C4C06@osite.com.br> <40de01f4$1@newsgroups.borland.com> <40DE437D.F599902C@osite.com.br> <40de5428$1@newsgroups.borland.com> <40DF591C.96CFDE8A@osite.com.br>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,5a2b0d594bbebb99
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <40DDCFFC.539C4C06@osite.com.br> <40de01f4$1@newsgroups.borland.com> <40DE437D.F599902C@osite.com.br> <40de5428$1@newsgroups.borland.com> <40DF591C.96CFDE8A@osite.com.br>
Subject: Re: Attachments with TIdMessage
Date: Sun, 27 Jun 2004 18:21:31 -0700
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.169.168.124
Message-ID: <40df7374$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1088385908 68.169.168.124 (27 Jun 2004 18:25:08 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail