Closed ChriswZeroOne closed 1 year ago
Hi @ChriswZeroOne!.
The library does not have a feature to give you a progress on the mail sending action...
The .waitForMailSent()
method gives you immediate feedback when the mail sending either success or fails with an error. But, there is no intermediate process information, as we are just sending data to the server.
If you're sending emails with large attachments, you could try to add a progress hook in MimeFile::writeContent
/ MimePart::writeContent
.
Right now MimePart::writeContent
dumps the entire content
at once on the QIODevice
. What you could do is to split up content
into multiple chunks (ex. ~64 kB), and write these chunks in a blocking fashion to QIODevice
by calling .write()
first then .waitForBytesWritten()
. After each successfully written chunks you could upgrade a progress percentage.
Thanks!
Hello,
Quick response on my other issue, your suggestion worked perfectly; Thank you. However is it possible to hook into waitForMailSent to add a progress bar. I see it takes a timeout variable of 30000 default; If I was to supply my own timeout to it and loop until it returns true (of course checking for errors) would this work? or is email processing stopped on timeout? Or is there a better way to do this?