SMTP strange problems - delphi6 + indy10 + gmail.com account ( SSL )

Giganews Newsgroups
Subject: SMTP strange problems - delphi6 + indy10 + gmail.com account ( SSL )
Posted by:  emilvv (emil…@gmail.com)
Date: Mon, 30 Oct 2006

I have a problem with SMTP with SSL support for GMAIL account.
The code is working, BUT working once - i mean when i send an email successfuly and try to send second
mail it is unsuccessful - mail is not arrive.

IF i send other email to other account ( POP3 ) with no SSL support and try to send
again email with gmail account ( SSL ) it is working again , but again for one email ....

Here is my code ...

Please helm me !!!
Thanks in advance

Emil

  EmailMessageToSend.Clear;
  EmailMessageToSend.From.Address := ......
  EmailMessageToSend.Recipients.EMailAddresses := ......
  EmailMessageToSend.CCList.EMailAddresses := .......
  EmailMessageToSend.BccList.EMailAddresses := ........
  EmailMessageToSend.Subject := ..........
  EmailMessageToSend.Priority := ...............
  EmailMessageToSend.Body.Assign ( memoTempEmail.Lines );

....
TIdAttachmentMemory.Create ( EmailMessageToSend.MessageParts, FileBlob ).FileName := ''filename.txt' ....

SMTP.Host := .......
SMTP.Port := '465';

SMTP.Username := 'username'
SMTP.Password := 'password'

SMTP.IOHandler := sslSMTP;
SMTP.UseTLS := utUseImplicitTLS;

SMTP.Connect;

if SMTP.Connected then begin
    ShowStatus ( 'Connected ...' );
    ShowStatus ( 'Sending ...' );
  end
  else begin
    ShowStatus ( 'Failed on connect ...' );
    exit;
end;

SMTP.Send ( EmailMessageToSend );

if SMTP.Connected then SMTP.Disconnect;

Replies