Autor Beitrag
eraser_seb
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 41



BeitragVerfasst: Fr 23.04.10 10:36 
Hi ihr progger.

Ich möchte Emails versenden mit der indey SMTP komponente. Aber weil manche wie google ssl benutzen habe ich ein Problem. Ich schaffe es einfach nicht eine Verbindung zubekommen. Habe viel ausprobiert.

es soll aber mit OpenSSL irgendwie gehn.

Mein Problem-> MUSS DELPHI 5 benutzen.

Bitte um Hilfe und bedanke mich im vorraus.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 23.04.10 11:25 
Und was hast du so z.B. ausprobiert?

_________________
PROGRAMMER: A device for converting coffee into software.
eraser_seb Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 41



BeitragVerfasst: Fr 23.04.10 13:51 
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.

ausblenden volle Höhe 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:
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);

// Denke mal sehr wichtiger abschnitt-----------------------
  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
ausblenden Delphi-Quelltext
1:
2:
3:
 idSSLH.SSLOptions.KeyFile  := '';
  idSSLH.SSLOptions.CertFile := '';
  idSSLH.SSLOptions.RootCertFile := '';


Oder ???

Danke im vorraus
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 23.04.10 14:21 
Und statt "ging auch nicht" erschien doch bestimmt auch immer eine Fehlermeldung, oder?
Edit: Und was hast du als Host eingetragen?

_________________
PROGRAMMER: A device for converting coffee into software.
eraser_seb Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 41



BeitragVerfasst: Fr 23.04.10 15:03 
OK . (Sorry wenn ich mich nicht klar ausdrücke)

Host ist: mail.googlemailcom

Wenn ich idSSLH.SSLOptions.Method := sslvSSLv3
auch bei idSSLH.SSLOptions.Method :=sslvSSLv23
auch idSSLH.SSLOptions.Method :=sslvSSLv3

kommt fehler:
Socket Error # 10060
Connection timed out.

Wenn ich idSSLH.SSLOptions.Method := sslvTLSv1

Socket Error # 10061
Connection refused.

Also ich denke mal das die methode "sslvTLSv1" schon richtig ist.
Oder ws sagst du dazu weiter?

danke eraser_seb
eraser_seb Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 41



BeitragVerfasst: Mi 28.04.10 15:45 
Schade habe gedacht jemand hätte eine Idee.

mfg

eraser_seb
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mi 28.04.10 15:48 
Sicher das die Firewall den Port nicht blockt? Oder gar das gesamte Programm?

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Mi 28.04.10 16:02 
Auch wenn ich mich wiederhole:
Was trägst du als Host (und auch Port) ein?
Für SMTPS braucht man nen anderen Port als normales SMTP, siehe Wikipedia..

_________________
PROGRAMMER: A device for converting coffee into software.
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mi 28.04.10 16:07 
dabei könnte das hier u.a. ganz hilfreich sein: mail.google.com/supp...=en&answer=78799

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
eraser_seb Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 41



BeitragVerfasst: Do 29.04.10 12:10 
Danke an euch.

Der Host ist smtp.googlemail.com. Aber ich denke mal es liegt an der Firewall.
Kann es aber leider nicht prüfen weil ich andere Sachen zu tuhn habe in moment.

Aber trotzdem nochmal danke.

mfg

Eraser_seb
platzwart
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1054
Erhaltene Danke: 78

Win 7, Ubuntu 9.10
Delphi 2007 Pro, C++, Qt
BeitragVerfasst: Do 29.04.10 12:17 
Port?

_________________
Wissenschaft schafft Wissenschaft, denn Wissenschaft ist Wissenschaft, die mit Wissen und Schaffen Wissen schafft. (myself)
eraser_seb Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 41



BeitragVerfasst: Do 29.04.10 13:24 
Port ist 465