Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Problem beim senden mit anhang - indy 9 (https://www.delphipraxis.net/113662-problem-beim-senden-mit-anhang-indy-9-a.html)

tobiroh 12. Mai 2008 18:09


Problem beim senden mit anhang - indy 9
 
Hallo liebe Leute,

Ich habe das Problem dass sich bei größeren Anhängen mein Delphiprogramm beim senden aufhängt.
Nach dem senden funktioniert es wieder.

Delphi-Quellcode:
if OpenDialog1.Execute then
   begin

    attach := TidAttachment.Create(msg.MessageParts, OpenDialog1.FileName);
    attach.DisplayName := msg.Subject;
    end;

smtp.AuthenticationType := atLogin;
smtp.Connect;
smtp.Authenticate;


try
 smtp.Send(msg);
finally
 showMessage('mail gesendet');
 smtp.Disconnect;
Ich benutze Indy 9

Ich bin sehr dankbar für schnelle gute Antworten :o

Valle 12. Mai 2008 19:47

Re: Problem beim senden mit anhang - indy 9
 
Ah, das hatten wir schon des öfteren in verschiedenen Variationen.

Das Problem ist, dass Indy in der Zeit, wo es mit dem Upload beschäftigt ist, den kompletten Thread in dem es läuft blockiert. Einfache Lösung: Du musst diese Aktion in einem Extra-Thread ausführen. Es gibt zwar eine Komponente TidAntiFreeze, die in meiner Erfahrung allerdings nie funktioniert hat.

Mit freundlichen Grüßen,

Valle

PS.: Zum Thema Threads: Hier im Forum suchenThreads


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:18 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz