Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Jul : problem with TIdSMTP

www.cryer.info
Managed Newsgroup Archive

problem with TIdSMTP

Subject:problem with TIdSMTP
Posted by:"Roberto Colpani" (roberto.colpa..@vetrariafratellicolpani.it)
Date:Wed, 6 Jul 2005 08:54:34

I have done a small application that when it's showed it send some email and
then it close.
TheSource is:

procedure TForm1.FormShow(Sender: TObject);
Var  strMsg: String;
begin
  Mail.Host := 'pop.something.it';
  Mail.Username  := 'username@someone.it';
  Mail.Password := 'APassword';
  try
    Mail.Connect;
    MailMessage.From.Name := 'ASubject';
    MailMessage.Subject := '<autorun>';
    MailMessage.Body.Insert(0,'This is a autogenerate message.');
    MailMessage.ReceiptRecipient.Address := 'username@someone.it';
    MailMessage.Recipients.EMailAddresses := 'myfriend@someone.it';
    Mail.Send(MailMessage);
    MailMessage.ReceiptRecipient.Address := 'username@someone.it';
    MailMessage.Recipients.EMailAddresses := anotherfriend@someone.it';
    Mail.Send(MailMessage);
finally
    Mail.Disconnect;
end;
  Application.Terminate;
end;

When the application run the first time it's all ok, but when I'm try a
second time an error of this kind:
'EIdSocketError with message 'Socket Error # 10053 software caused
connection abort',  occur at the row "Mail.Connect".
Someone can help me?
roberto.colpani@vetrariafratellicolpani.it

Replies:

www.cryer.info
Managed Newsgroup Archive