AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Indy10, SSLPalin, SMTP, "Authentification required"
Thema durchsuchen
Ansicht
Themen-Optionen

Indy10, SSLPalin, SMTP, "Authentification required"

Ein Thema von hoika · begonnen am 26. Apr 2013 · letzter Beitrag vom 29. Apr 2013
 
hoika

Registriert seit: 5. Jul 2006
Ort: Magdeburg
8.277 Beiträge
 
Delphi 10.4 Sydney
 
#1

Indy10, SSLPalin, SMTP, "Authentification required"

  Alt 26. Apr 2013, 11:11
Hallo #,

ich beziehe mich mit meiner Frage auf folgenden Thread

Der Fehler heisst "Authentication error", nicht wie es oben steht.

http://www.delphipraxis.net/174452-x...nt-senden.html

Ich muss einem Mailserver über SSL (Plain) eine Mail schicken.
Code sieht so aus.
Man sieht am Code, ich probier verzweifelt alles aus ...

Delphi-Quellcode:
procedure TForm1.ButtonMailClick(Sender: TObject);
var
  SMTP: TIdSMTP;
  Msg: TIdMessage;
begin

  IdUserPassProvider1.Username := EditNutzerName.Text;
  IdUserPassProvider1.Password := EditPassWort.Text;

  IdSASLLogin1.UserPassProvider := IdUserPassProvider1;

  SMTP := TIdSMTP.Create(nil);
  Msg := TIdMessage.Create;
  try
    SMTP.PipeLine := True;



// SMTP.AuthType := satDefault;
    SMTP.ValidateAuthLoginCapability := False;

    SMTP.IOHandler := CreateSSLHandler(SMTP); // siehe unten

// SMTP.AuthType := satDefault;
    SMTP.AuthType := satSASL;

// SMTP.SASLMechanisms.Add.SASL := IdSASLLogin1;

    SMTP.SASLMechanisms.Add.SASL := IdSASLPlain1;

    SMTP.UseTLS := utUseImplicitTLS;
    SMTP.Host := EditServer.Text;
    SMTP.Port := StrToInt(EditPortSMTP.Text);
    SMTP.Username := EditNutzerName.Text;
    SMTP.Password := EditPassWort.Text;
    SMTP.Connect;

    Msg.From.Address:= EditSourceMail.Text;
    with Msg.Recipients.Add do
    begin
      Address := EditTargetMail.Text;
    end;
    Msg.Subject:= 'Test';

    SMTP.Send(Msg); <<-- Exception

    SMTP.Disconnect;
  finally
    Msg.Free;
    SMTP.Free;
  end;
end;
Hangel ich mich durch den Code, komme ich hier hin

unit IdSMTPBase
Delphi-Quellcode:
procedure TIdSMTPBase.SendNoPipelining(AMsg: TIdMessage; const AFrom: String; ARecipients: TIdEMailAddressList);
var
  LCmd: string;
begin
  LCmd := MAILFROM_CMD + '<' + AFrom + '>'; {Do not Localize}
  if FUseVerp then begin
    if Capabilities.IndexOf(CAPAVERP) > -1 then begin
      LCmd := LCmd + ' VERP'; {Do not Localize}
    end else begin
      LCmd := LCmd + ' XVERP'; {Do not Localize}
    end;
    if FVerpDelims <> 'then begin
     LCmd := LCmd + '=' + FVerpDelims; {Do not Localize}
    end;
  end;
  SendCmd(RSET_CMD);

//// hier knallts im SendCmd


  SendCmd(LCmd, MAILFROM_ACCEPT);
end;

function TForm1ClickTest.CreateSSLHandler(Owner: TComponent): TIdSSLIOHandlerSocketOpenSSL;
begin
  Result := TIdSSLIOHandlerSocketOpenSSL.Create(Owner);
  Result.OnVerifyPeer := SSLVerifyPeerEventHandler;
  Result.SSLOptions.Method := sslvSSLv3;
  Result.SSLOptions.VerifyMode := [sslvrfClientOnce];
end;

Das PerformSASLLogin ist bereits erfolgreich verlaufen.

Was kann ich noch tun ?

Danke


Heiko
Heiko

Geändert von hoika (26. Apr 2013 um 15:21 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:31 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz