Autor Beitrag
klezmor
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Mi 26.03.08 18:33 
Ich möchte aus meiner delphiapplikation eine Email an mich selbst versenden und dies über die indykomponente smtp machen.

Ansatz ist folgender:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
   
   msg:=TidMessage.Create(nil);
   smtp:=TidSMTP.Create(nil);
   msg.Clear;
   msg.body.Add('Hallo');
   msg.From.Address :='test@googlemail.com';
   msg.Recipients.EMailAddresses :='test@googlemail.com';
   msg.Subject   := 'Hallo';
   if FileExists(filename)then
    TIdAttachment.Create(msg.MessageParts,filename);
   smtp.Host     := 'smtp.googlemail.com';
   smtp.Username := 'test@googlemail.com';
   smtp.Password := 'xxx';
   smtp.Port := 465;
   smtp.IOHandler:=IdSSlIOHandlerSocket1;   
   SMTP.Connect(1000);
   SMTP.Send(Msg);
 finally
   smtp.disconnect;
   smtp.Free;
   msg.Free;
 end;


wenn ich den code ausführe stürzt er beim verbinden ab. Bei meinem account habe ich pop aktiviert(smtp selbst kann man da unter einstellungen nicht aktivieren). Als Fehlermeldung kommt folgendes: 5.5.1 Authentication Required j2sm39708857mue.3

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
FrankBKK
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win XP
D5
BeitragVerfasst: Di 01.04.08 16:19 
Ich kenne die Indy-Komponenten nicht,
aber bei Gmail brauchst Du eine Secure TLS Connection,
das muesste bei einer SMTP-AUTH Property eingestellt werden koennen
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Di 01.04.08 16:43 
ja das verbinden klappt ganz gut, aber ich möchte die sasl authorisierung verwenden und das passwort als md5 hash speichern und habe keine ahnung wie das mit dem passwort funktionieren soll.

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
Sirke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 208
Erhaltene Danke: 2



BeitragVerfasst: Di 01.04.08 20:16 
Du hast ja nicht ein mal eine Authorisierung drin! Du musst auf jeden Fall vorher den Authorisierungsbefehl geben! Dieser würde ich sagen, ist dann erstmal im Klartext und wenn das Klappt kannst du dann mit SASL rumexperimentiern!
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Do 03.04.08 15:55 
also wenn man über indy zu nem ftpserver konnektet, muss man ja auch keine explizite authorisierung angeben und bis jetzt hat es bei mir eigetnlich ganz gut funkioniert, aber wie eine authosrisierung über sasl funktioniert das habe ich ncoh nicht hinbekommen.

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth
Sirke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 208
Erhaltene Danke: 2



BeitragVerfasst: Do 03.04.08 17:48 
Es wird bei SMTPs eine Authorisierung gefordert, um nachzuvollziehen, wenn wer was getan hat, damit man Missbrauch vorbeugen bzw. nachweisen kann!

Ich bekomme bei mir ebenfalls keine Authorisierung mit der SASL Komponente hin, liegt aber daran, dass ich einen Ausnahmefehler beim Speicherzugriff bekomme! Eine ohne die Komponente, also im Klartext dagegen funktioniert!
klezmor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Do 03.04.08 23:47 
könnetst du vielleicht mal deinen code posten?

_________________
"Beware of bugs in the above code; I have only proved it correct, not tried it." Donald Knuth