Article View: borland.public.cppbuilder.internet.socket
Article #2103Re: How to send an attachment to an e-mail
From: Remy Lebeau (TeamB)
Date: Wed, 16 Aug 2006 01:40
Date: Wed, 16 Aug 2006 01:40
24 lines
1790 bytes
1790 bytes
"David Ayre" <davidcayre@ntlworld.com> wrote in message
news:44e2178f$1@newsgroups.borland.com...
> But how do I do that? There doesn't seem to be a
> TIdAttachment component in the Indy list.
TIdText and TIdAttachment are not components. They are TCollectionItem
descendants. You have to instantiate them programmably in code, ie:
TIdText *text = new TIdText(IdMessage1->MessageParts, NULL);
text->ContentType = "text/plain";
text->Body->Text = "whatever";
TIdText *html = new TIdText(IdMessage1->MessageParts, NULL);
html->ContentType = "text/html";
html->Body->Text = "<html>whatever</html>";
TIdAttachment *attach = new TIdAttachment(IdMessage1->MessageParts,
"c:\\some file.ext");
attach->ContentType = GetMimeTypeFromFile(attach->FileName);
Gambit
Technical Details
Message-ID:
<44e2793f$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44e2059a$1@newsgroups.borland.com> <44e213f5$1@newsgroups.borland.com> <44e2178f$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f90837efd85511de X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <44e2059a$1@newsgroups.borland.com> <44e213f5$1@newsgroups.borland.com> <44e2178f$1@newsgroups.borland.com> Subject: Re: How to send an attachment to an e-mail Date: Tue, 15 Aug 2006 18:40:56 -0700 Lines: 26 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.69.17.41 Message-ID: <44e2793f$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1155692863 68.69.17.41 (15 Aug 2006 18:47:43 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail