Closed BL-Bl4ckBut7ch3r closed 6 months ago
The MimeMultiPart.addPart(...)
method takes ownership on the parts you pass as parameters. In the destructor the parts are also deleted, and I think you program may fail because of a double deletion of the MimeText
object.
One thing you could try, is to create the MimeText
object on the heap with new MimeText(...)
, instead of creating it on the stack.
I will test it right away.
That solves the issue. Thanks.
(Minor other thing is i get QObject::connect: No such signal QSslSocket::errorOccurred(QAbstractSocket::SocketError)
I did modify the cpp to connect to error instead of errorOccurred but it didn't seemed to affect this one problem, although I will ignore it for now)
(Minor other thing is i get
QObject::connect: No such signal QSslSocket::errorOccurred(QAbstractSocket::SocketError)
I did modify the cpp to connect to error instead of errorOccurred but it didn't seemed to affect this one problem, although I will ignore it for now)
In recent versions of Qt 5/6 (>5.15) the QAbstractSocket::error
signal was renamed to errorOccurred
.
Hi there!
I managed to setup this client on Windows (irrevelant but, I use Win 11 pro) but as I send the e-mail out (which does arrive to the client) it crashes my program with no clear indication of what the SmtpClient screws up. Currently I'm using Qt Creator 5.0.2 with MinGW 64bit.
What I was able to track down so far are the following:
The line in my code that fails:
message.addPart(&text);
Here is an example of what kind of data do I pass to the text variable:
text.setText(ui->OutputLabel->toPlainText());
(OutputLabel is a QTextBrowser and from that straight the QString)The QString looks like this all of the times: (example and also for consistency test I never changed the QString which I would send) hthIhtfadEc8stdEyvkKz9hsyxhIyvkKdEbtyoa5yvkKc8hIhthIhtfahthIyzbtdEbtyoa5yvkKc8hIyvkKz9hsc8hIc8ZryxdDraezhthIyzbtyxdDraezhthIyzbtJkhIa5gac8hIhxGcJkbtz9hsJkbtz9hsgac8gac89b9b==
And in debug mode I get this:
After this I tracked to the issue causer as much as I could (see after this phrase), but from here on I don't really know what should I do.
The function that kills it:
Thank you for your help in advance!