Also als erstes habe ich die indy SMTP Komponente genommen und habe verssucht auf mein googlemail account zu verbinden.
Das ging nicht. Da kam dann "socket error 10060" dann habe ich gelesen im Netz das sich bei ssl die Ports ändern (587 oder 465). das ging auch nicht.
So dann fand ich herraus das man die TIdSSLIOHandlerSocket Komponente dder SMPT komponente zuweisen soll. Das habe ich gemacht. gig auch nicht.
Der Code.
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: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76:
| procedure TForm1.Button1Click(Sender: TObject); var msg : TIdMessage; begin try memo1.Lines.Clear; msg := TIdMessage.Create(nil); idSSLH := TIdSSLIOHandlerSocket.Create(nil);
idSSLH.SSLOptions.KeyFile := ''; idSSLH.SSLOptions.CertFile := ''; idSSLH.SSLOptions.RootCertFile := '';
msg.From.Address := 'name@gmx.de'; msg.From.Name := 'name'; msg.Subject := 'versuche eine mail zu schicken'; msg.Body.Add('Das ist ein Test');
smtp.Username := emailaddr.Text; smtp.Password := epasswort.Text; smtp.Host := ehost.Text; smtp.Port := strtoint(eport.text); smtp.AuthenticationType := atLogin;
idSSLH.SSLOptions.Method := TIdSSLVersion(C_sslmethod.ItemIndex); idSSLH.SSLOptions.Mode := sslmUnassigned;
smtp.IOHandler := idSSLH;
application.ProcessMessages; try smtp.Connect; smtp.Send(msg); except on e:exception do begin memo1.Lines.Add(e.Message); end; end; finally smtp.Disconnect; end; end;
procedure TForm1.FormShow(Sender: TObject); begin C_sslmethod.ItemIndex := 0; end;
procedure TForm1.idSSLHStatus(ASender: TObject; const AStatus: TIdStatus; const AStatusText: String); begin memo1.Lines.add(Astatustext); case Astatus of hsResolving : memo1.Lines.add('Status : Resolving'); hsConnecting : memo1.Lines.add('Status : Connecting'); hsConnected : memo1.Lines.Add('Status : Connected'); hsDisconnecting : memo1.Lines.add('Status : Disconnecting'); hsDisconnected : memo1.Lines.add('Stauts : Connected'); hsStatusText : memo1.Lines.add('Status : Statustext'); ftpTransfer : memo1.Lines.add('Status : ftpTransfer'); ftpReady : memo1.Lines.add('Status : ftpready'); ftpAborted : memo1.Lines.add('Status : ftpAbort'); end;
end;
procedure TForm1.idSSLHGetPassword(var Password: String); begin
password := epasswort.Text; end;
end. |
Ich denke mal ich brauche diese Files für
Delphi-Quelltext
1: 2: 3:
| idSSLH.SSLOptions.KeyFile := ''; idSSLH.SSLOptions.CertFile := ''; idSSLH.SSLOptions.RootCertFile := ''; |
Oder ???
Danke im vorraus