🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: problem using INDY component when sending email

#1141
From: Van Wouwe Francois
Date: Tue, 27 Mar 2007 11:55
79 lines
3155 bytes
Hi,

think that this code should work

BCB = version 4
Indy = 9.0.4



private: // User declarations
    String maillist;

void __fastcall TF_Deelnemers::Email1Click(TObject *Sender)
{
    String temp,tornooi,tornooinaam,mailsettings;
    maillist="";

    tornooinaam="tornooi";
    maillist="test@test";
    TIdEMailAddressItem *MAILLIST = IdMessage1->Sender;
    TIdEMailAddressList *TOLIST = new  TIdEMailAddressList(this);
    TIdEMailAddressList *BCCLIST = new  TIdEMailAddressList(this);
    mailsettings="email from";
    MAILLIST->Name=mailsettings;
    mailsettings="test@test";
    MAILLIST->Address=mailsettings;
    TOLIST->EMailAddresses=maillist;
    IdMessage1->Recipients=TOLIST;
    IdMessage1->From=MAILLIST;
    IdMessage1->Sender=MAILLIST;
    maillist="francois.van.wouwe@skynet.be";
    BCCLIST->EMailAddresses=maillist;
    IdMessage1->BccList=BCCLIST;
            IdMessage1->Subject="Confirmation of inscription ";
    IdMessage1->ContentType="text/plain";
    IdMessage1->Body->Clear();
            IdMessage1->Body->Add("\nWith sporty greetings\n");
    mailsettings="relay.skynet.be";
    IdSMTP1->Host=mailsettings;
    mailsettings="sky83302";
    IdSMTP1->Username=mailsettings;
    if (!IdSMTP1->Connected())
        {
        IdSMTP1->Connect(-1);
        }
    IdSMTP1->Send(IdMessage1);
    IdSMTP1->Disconnect();
    delete TOLIST;
    delete BCCLIST;
    IdSMTP1->Destroying();
    IdMessage1->Destroying();
    ShowMessage("E-mail is verstuurd");
}

kind regards
Francois Van Wouwe


-- 
met vriendelijke groeten

Francois Van Wouwe
"Hans Galema" <notused@notused.nl> wrote in message 
news:4608f66e@newsgroups.borland.com...
> Van Wouwe Francois wrote:
>
>> When I use the SMTP component for sending email, the mail is send out,
>
> Which Indy version do you use? Version of bcb?
>
>> but when I close the form
>> I get an access violation at a given address, during the read of that 
>> address.
>
> Please post a complete example. As small as possible. Whitout
> the use of the database. So we can compile and link to see what
> happens.
>
> Hans. 
Technical Details
Message-ID: <4609061e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4608f043$1@newsgroups.borland.com> <4608f66e@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,1c868e923aa6cca0
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Van Wouwe Francois" <francois.van.wouwe@skynet.be>
From: "Van Wouwe Francois" <francois.van.wouwe@skynet.be>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <4608f043$1@newsgroups.borland.com> <4608f66e@newsgroups.borland.com>
Subject: Re: problem using INDY component when sending email
Date: Tue, 27 Mar 2007 13:55:00 +0200
Lines: 81
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 80.200.217.253
Message-ID: <4609061e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1174996510 80.200.217.253 (27 Mar 2007 04:55:10 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail