Closed ghorwin closed 1 year ago
Hello! The issue is that the QTimer is declared inside of the if() statement. This causes the QTimer object to be destroyed before loop.exec() is called.
Simply the line "QTimer timer" needs to be moved before "if(msec > 0)". That is all.
I'm not familiar with how making changes here works on github so I cannot change it myself, but that will fix it for you.
Greetings!
Thanks, works!
Hello, thank you for your message. I need your service if possible have good smtp to launch messages accompanied by files thank you I also have
Le lun. 28 nov. 2022 à 14:04, Andreas Nicolai @.***> a écrit :
Thanks, works!
— Reply to this email directly, view it on GitHub https://github.com/bluetiger9/SmtpClient-for-Qt/issues/125#issuecomment-1329163969, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4N6FZSNROVZYSJOPS6H3B3WKS3YLANCNFSM6AAAAAARXMKLPU . You are receiving this because you are subscribed to this thread.Message ID: @.***>
The function
takes a timeout argument. It is expected, that the QTimer triggers
QEventLoop::quit()
after said timeout, yet this never happens. As a consequence, the loop 'hangs' until the socket sends a NetworkError (via signalerror()
) and by this triggers the quit() slot (on my machine after roughly 50 seconds).I am not sure why this is, but the problem can be readily reproduced - at least on Windows 10.
Unless this bug is fixed, using the synchronous API is not realiably usable in a situation where the connection to mail server is unstable.