Article View: borland.public.cppbuilder.internet.socket
Article #5537Re: Deleting Sent Attachments in Indy SMTP
From: Antonio Donato
Date: Sun, 01 Aug 2004 17:01
Date: Sun, 01 Aug 2004 17:01
112 lines
3511 bytes
3511 bytes
Dear Remy,
actual code is this:
> int c;
> char textlabel[600];
> char TmpFileAddress[600];
> char ToMailTag[600], SubjectMailTag[2000];
> char CCMailTag[20000];
>
>
> strcpy(ToMailTag, ToEdit->Text.c_str());
>
> IndyMessage->Recipients->EMailAddresses=AnsiString(ToMailTag);
>
> strcpy(CCMailTag, CCEdit->Text.c_str());
>
> IndyMessage->CCList->EMailAddresses=AnsiString(CCMailTag);
>
> strcpy(SubjectMailTag, SubjectEdit->Text.c_str());
>
> IndyMessage->Subject=AnsiString(SubjectMailTag);
>
> if(AttachFileOne[0]!=0)
> TIdAttachment *attachment1 = new TIdAttachment(IndyMessage->MessageParts, AttachFileOne);
>
> outfp=fopen(TmpFileAddress, "w");
> fclose(outfp);
>
> RichEdit->PlainText=true;
> RichEdit->Lines->SaveToFile(AnsiString(TmpFileAddress));
> IndyMessage->Body->LoadFromFile(AnsiString(TmpFileAddress));
>
> try
> {
> IndySMTP->Connect(-1);
> }
>
> catch(...)
> {
> sprintf(textlabel, "Impossible connecting");
> OKDialog->DialogLabel->Caption = AnsiString(textlabel);
> OKDialog->Caption = "Message Box";
> OKDialog->ShowModal();
>
> IndySMTP->Disconnect();
>
> return;
> }
>
> try
> {
> IndySMTP->Send(IndyMessage);
> }
>
> catch(...)
> {
> sprintf(textlabel, "Impossible mailing");
> OKDialog->DialogLabel->Caption = AnsiString(textlabel);
> OKDialog->Caption = "Message Box";
> OKDialog->ShowModal();
>
> IndySMTP->Disconnect();
>
> //Note: with or without line "if(attachment1!=NULL)"
> //code does not compile and BC++ message is:
> //"Undefined symbol attachment1"
>
>
> if(attachment1!=NULL)
> delete attachment1;
>
> return;
> }
>
> IndySMTP->Disconnect();
>
> //Note: with or without line "if(attachment1!=NULL)"
> //code does not compile and BC++ message is:
> //"Undefined symbol attachment1"
>
> if(attachment1!=NULL)
> delete attachment1;
>
> sprintf(textlabel, "Successful sending");
> OKDialog->DialogLabel->Caption = AnsiString(textlabel);
> OKDialog->Caption = "Message Box";
> OKDialog->ShowModal();
>
>
I thank you very much all your attention.
Antonio
"Remy Lebeau (TeamB)" ha escrito:
> "Antonio Donato" <espvida@osite.com.br> wrote in message
> news:410AA00A.2810F892@osite.com.br...
>
> > When writing
> >
> > delete attachment1;
> >
> > compiling says "Undefined symbol attachment1", when
> > it should not be undefined.
>
> Please show your actual code. My guess would be that you are trying to
> delete something that is no longer in scope.
>
> Gambit
Technical Details
Message-ID:
<410D21DA.B5B85B81@osite.com.br>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<410A91BD.B2B07735@osite.com.br> <410a9542$1@newsgroups.borland.com> <410AA00A.2810F892@osite.com.br> <410ab839$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,7d6c5fd30befdd4b X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Message-ID: <410D21DA.B5B85B81@osite.com.br> Date: Sun, 01 Aug 2004 14:01:14 -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: Deleting Sent Attachments in Indy SMTP References: <410A91BD.B2B07735@osite.com.br> <410a9542$1@newsgroups.borland.com> <410AA00A.2810F892@osite.com.br> <410ab839$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 1091380207 200.171.143.68 (1 Aug 2004 10:10:07 -0700) Lines: 113 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail