Indy SMTP server is refusing connection

SMTP server and my ISP SMTP server too with no success. I try various ports (Yahoo! ... If I don't use STARTTLS, I get "Access denied" try MMsg.Recipients.

Indy SMTP server is refusing connection

There is no problem to connect to the TIdSMTPServer

type
  TForm1 = class( TForm )
    IdSMTP1 : TIdSMTP;
    IdSMTPServer1 : TIdSMTPServer;
    Button1 : TButton;
    ListBox1 : TListBox;
    procedure Button1Click( Sender : TObject );
    procedure IdSMTPServer1Connect( AContext : TIdContext );
    procedure IdSMTPServer1Disconnect( AContext : TIdContext );
  private
    procedure Log( const AMsg : string );
  public
    { Public-Deklarationen }
  end;

var
  Form1 : TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click( Sender : TObject );
begin
  // Server Settings
  IdSMTPServer1.DefaultPort := 6728;
  IdSMTPServer1.OnConnect := IdSMTPServer1Connect;
  IdSMTPServer1.OnDisconnect := IdSMTPServer1Disconnect;
  // Client Settings
  IdSMTP1.Host := '127.0.0.1';
  IdSMTP1.Port := IdSMTPServer1.DefaultPort;
  // Connect Client to Server
  IdSMTPServer1.Active := True;
  try
    IdSMTP1.Connect;
    IdSMTP1.Disconnect( True );
  finally
    IdSMTPServer1.Active := False;
  end;
end;

procedure TForm1.Log( const AMsg : string );
begin
  if MainThreadID = TThread.CurrentThread.ThreadID
  then
  begin
    ListBox1.ItemIndex := ListBox1.Items.Add( AMsg );
  end
  else
    TThread.Queue( nil,
        procedure
      begin
        Log( AMsg )
      end );
end;

procedure TForm1.IdSMTPServer1Connect( AContext : TIdContext );
begin
  Log( 'Connect' );
end;

procedure TForm1.IdSMTPServer1Disconnect( AContext : TIdContext );
begin
  Log( 'Disconnect' );
end;

Click Here to Visit

What's Your Reaction?

like
0
dislike
0
love
0
funny
0
angry
0
sad
0
wow
0