Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Apr : using SMTP client

www.cryer.info
Managed Newsgroup Archive

using SMTP client

Subject:using SMTP client
Posted by:"Holger Flick" (rammbaer.x..@xyz.gmx.de)
Date:Fri, 8 Apr 2005 12:42:48

Hi,

I try to send a mail using the TIdSMTPClient. It's the .NET version that
came with D2005. It works fine for small mails (just like for the
POP3Client), but with mails with bigger attachements (but still much
smaller than 2 MB) it fails. I get the exception message that the remote
server cancelled the transmission after some time. Is something wrong in
my code? I do not use any events of TIDSMTPClient...

    if Assigned( o ) then begin
       s.Position := 0;
       m := TIdMessage.Create;
       m.LoadFromStream( s );

       clSMTP.Host := o.server;
       clSMTP.Username := o.login;
       clSMTP.Password := o.password;
       clSMTP.Port := StrToInt( o.port );
       clSMTP.Connect;
       clSMTP.Send( m );    // <--- is this correct and sufficient?
       clSMTP.Disconnect;
     end;

--
Holger

Replies:

www.cryer.info
Managed Newsgroup Archive