Also so langsam bin ich am verzweifeln! Ich hab die selbe Funktion in nem anderen Prog benutzt, aber da läuft alles einwandfrei!
Das Problem: Die Datei wird verschlüssel, aber nicht verschickt!
(Und JA! Die Kontodaten sind richtig!)
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:
| function tform1.SendEmail(Recipient:string;Body:TStringList):boolean; var sl:tstringlist; begin if IsInternetConnected=false then begin showmessage('Es besteht keine Verbingung zum Internet.');result:=false;exit;end else begin sl:=tstringlist.Create; sl.LoadFromFile(thefile); sl.Text:=EncodeText(sl.Text,'test'); sl.SaveToFile(thefile);
idSMTP.Host := 'pop.onlinehome.de'; idSMTP.Username := 'user'; idSMTP.Password := 'passwort'; idSMTP.Port := 25; idMessage.From.text :='abc@online.de';
idMessage.Sender.text:=idMessage.From.text; TIdAttachment.Create(IdMessage.MessageParts,(thefile)); idMessage.Recipients.EMailAddresses:= Recipient; idMessage.CCList.EMailAddresses := ''; idMessage.Subject:= 'Runewars Master Server'; idMessage.Body.Clear; idMessage.Body := Body;
try idSMTP.Connect; idSMTP.Send(idMessage); idSMTP.Disconnect; result:=True; if FileExists(thefile) then DeleteFile(thefile); except on E : Exception do begin if idSMTP.connected then try idSMTP.disconnect; except end; result := false; end; end; end; end; |