![]() |
Problem mit INDY, SMTP und SSL
hallo,
ich versuche per imap mit ssl eine nachricht zu verschicken. leider bekomm ich immer eine fehlermeldung, die ich nicht zuordnen kann. hat jmd eine idee was da falsch läuft? danke.
Code:
---------------------------
Benachrichtigung über Debugger-Exception --------------------------- Im Projekt gFTP.exe ist eine Exception der Klasse EIdOSSLConnectError mit der Meldung 'Error connecting with SSL.' aufgetreten. --------------------------- Anhalten Fortsetzen Hilfe ---------------------------
Delphi-Quellcode:
constructor TgMailFTP.Create(AUsername, APassword: string;
AStringGrid: TStringGrid; AComboBox: TComboBox); begin FsmtpHost := 'smtp.gmail.com'; FUsername := AUsername; FPassword := APassword; FsmtpPort := 587; Fsmtp := TIdSMTP.Create; Fsmtp.Host := FsmtpHost; Fsmtp.Username := FUsername; Fsmtp.Password := FPassword; Fsmtp.Port := FsmtpPort; Fsmtp.AuthType := atDefault; Fsmtp.MailAgent := 'Thunderbird 2.0.0.9 (Windows/20071031)'; Fssl := TIdSSLIOHandlerSocketOpenSSL.Create; Fssl.ConnectTimeout := 15000; Fssl.SSLOptions.Method := sslvTLSv1; Fssl.SSLOptions.Mode := sslmClient; Fssl.SSLOptions.VerifyMode := []; Fssl.SSLOptions.VerifyDepth := 0; Fsmtp.IOHandler := FSSL; Fsmtp.UseTLS := utUseImplicitTLS; end;
Delphi-Quellcode:
procedure TgMailFTP.New(AStr: string; AIsFile: Boolean = True);
var Mail: TIdMessage; begin Fssl.Host := FsmtpHost; Fssl.Port := FsmtpPort; Mail := TIdMessage.Create; Mail.From.Address := FUsername; Mail.Recipients.EMailAddresses := FUsername; Mail.Subject := 'gFTP:' + FPath + AStr + '/|-1'; try try Fsmtp.Connect; Fsmtp.Send(Mail); //Hier kommt der Fehler except end; finally if Fsmtp.Connected then Fsmtp.Disconnect; Mail.Free; end; end; |
Re: Problem mit INDY, SMTP und SSL
unauffälliges pushen
|
Re: Problem mit INDY, SMTP und SSL
hat jmd vllt einen funktionierenden code zum thema? ich bin doch net der erste, der das macht^^
|
Re: Problem mit INDY, SMTP und SSL
du bekommst keine verbindung.
wenn du imap machen willst dann ist das port 143. wenn du imap-ssl machen willst dann ist das port 993. deine angabe
Delphi-Quellcode:
verwirrt mich.
FsmtpPort := 587
dein code hat nichts mit imap zutun. daher: smtp ist port 25 und smtp-ssl ist port 465. viele smtp server machen kein smtp-ssl. eigendlich wird in der praxis eher smtp genutzt welches mit tls geschütz wird. das läuft dann alles über port 25. |
Re: Problem mit INDY, SMTP und SSL
die ports mögen dich verwirren, ist aber bei googlemail standard^^ (
![]() //Edit ich musste nur auf Fsmtp.UseTLS := utUseExplicitTLS; stellen. jetzt funktioniert es. danke^^ |
Re: Problem mit INDY, SMTP und SSL
ich gebe
Delphi-Quellcode:
ein und es kommt die fehlermeldung:
smtp.UseTLS := utUseImplicitTLS;
Unit1.pas(688): E2003 Undefinierter Bezeichner: 'utUseImplicitTLS' |
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:23 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