Hey,
ich versuche eine Mail mit den Indy Komponenten über Gmail zu verschicken.
TLS wird verlangt, kriege ich aber mit den Indys nicht hin.
Exception:
Quelltext
1: 2:
| Im Projekt Project1.exe ist eine Exception der Klasse EIdSMTPReplyError mit der Meldung 'Must issue a STARTTLS command first. w11sm2090582fad.7 ' aufgetreten. |
Folgenden Code habe ich bis jetzt:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30:
| procedure SendMail; var IdMessage : TIdMessage; IdSMTP : TIdSMTP; begin IdMessage := TIdMessage.Create(nil); IdSMTP := TIdSMTP.Create(nil); try with IdSMTP do begin Host := 'smtp.googlemail.com'; Username := 'xxx'; Password := 'xxx'; Port := 587; AuthType := satDefault; end; with IdMessage do begin From.Text := 'xxx'; Sender.Text := From.Text;
Recipients.EMailAddresses := 'xxx'; Subject := 'Test'; end; idSMTP.Connect; idSMTP.Send(IdMessage); finally IdMessage.Free; IdSMTP.Free; end; end; |
Hat jemand einen Tipp?
lg