Article View: borland.public.cppbuilder.internet.socket
Article #5634Re: Attachments with TIdMessage
From: Antonio Donato
Date: Sun, 27 Jun 2004 23:32
Date: Sun, 27 Jun 2004 23:32
107 lines
3554 bytes
3554 bytes
Dear Remy Lebeau,
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, but there are in it
Icons for TIdMessage and TIdSMTP, which I put in application form. Absence of
TIdAttachment in Component Palette in BC++ is something correct or wrong?
I thank you very much for all your and any other's attention.
Antonio Donato
> IndyMessage->From->Name=AnsiString(NameMailTag);
> IndyMessage->From->Address=AnsiString(ReturnMailTag);
> IndyMessage->Recipients->EMailAddresses=AnsiString(ToMailTag);
> IndyMessage->CCList->EMailAddresses=AnsiString(CCMailTag);
> IndyMessage->BccList->EMailAddresses=AnsiString(CCOMailTag);
> IndyMessage->Subject=AnsiString(SubjectMailTag);
>
> IndySMTP->Host=AnsiString(SMTPMailTag);
> IndySMTP->Username=AnsiString(LoginMailTag);
> IndySMTP->Password=AnsiString(PasswordMailTag);
> IndySMTP->AuthenticationType=atLogin;
>
>
> strcpy(AttachTag, MailForm->AttachEdit->Text.c_str());
>
> outfp=fopen(TmpFileAddress, "w");
> fclose(outfp);
>
> RichEdit->PlainText=true;
> RichEdit->Lines->SaveToFile(AnsiString(TmpFileAddress));
> IndyMessage->Body->LoadFromFile(AnsiString(TmpFileAddress));
>
> if(AttachTag[0]!=0)
> {
> TIdAttachment *attachment = new TIdAttachment(IndyMessage, AttachTag);
> attachment->FileName = "file.zip";
> }
>
>
> TCursor oldCursor = Screen->Cursor;
> Screen->Cursor = crHourGlass;
> Application->ProcessMessages();
>
>
> try
> {
> IndySMTP->Connect(-1);
> }
>
> catch(...)
> {
> sprintf(textlabel, "Impossible to connect.");
> OKDialog->DialogLabel->Caption = AnsiString(textlabel);
> OKDialog->Caption = "Message Box";
> OKDialog->ShowModal();
>
> IndySMTP->Disconnect();
> Screen->Cursor = oldCursor;
> Close();
> return;
> }
>
>
> try
> {
> IndySMTP->Send(IndyMessage);
> }
>
> catch(...)
> {
> sprintf(textlabel, "Impossible to send");
> OKDialog->DialogLabel->Caption = AnsiString(textlabel);
> OKDialog->Caption = "Message Box";
> OKDialog->ShowModal();
>
> IndySMTP->Disconnect();
> Screen->Cursor = oldCursor;
> return;
> }
>
> IndySMTP->Disconnect();
>
> Screen->Cursor = oldCursor;
>
>
"Remy Lebeau (TeamB)" ha escrito:
> "Antonio Donato" <espvida@osite.com.br> wrote in message
> news:40DE437D.F599902C@osite.com.br...
>
> > I compiled that code below and the result was:
> >
> >
> > Could not find a match for 'TIdAttachment::TIdAttachment(TIdMessage *,
> char")'
>
> Please show your actual code.
>
> Gambit
Technical Details
Message-ID:
<40DF591C.96CFDE8A@osite.com.br>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news-hog.berkeley.edu!ucberkeley!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40DDCFFC.539C4C06@osite.com.br> <40de01f4$1@newsgroups.borland.com> <40DE437D.F599902C@osite.com.br> <40de5428$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,5a2b0d594bbebb99 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Message-ID: <40DF591C.96CFDE8A@osite.com.br> Date: Sun, 27 Jun 2004 20:32:44 -0300 From: Antonio Donato <espvida@osite.com.br> X-Mailer: Mozilla 4.78 [es] (Win98; U) X-Accept-Language: es MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: Attachments with TIdMessage References: <40DDCFFC.539C4C06@osite.com.br> <40de01f4$1@newsgroups.borland.com> <40DE437D.F599902C@osite.com.br> <40de5428$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 200.171.143.68 X-Trace: newsgroups.borland.com 1088379702 200.171.143.68 (27 Jun 2004 16:41:42 -0700) Lines: 108 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news-hog.berkeley.edu!ucberkeley!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail