An SMTP Client writen in C++ for Qt. Allows applications to send emails (MIME with text, html, attachments, inline files, etc.) via SMTP. Supports SSL and SMTP authentication.
In all of the samples, the SmtpClient is deleted right after the quit() command, and the instance is not reused. The proposed changes implement the QUIT command fully and allow waiting for the server to close the connection. Critical variables are reset so that the connection can be reopened later.
The QTimer in SmtpClient::waitForEvent() was getting destroyed right after starting it, so that a timeout could never happen. Moving the instantiation to before the initialization scope solves that.
Flushing the socket stream after writing instead of before writing to it makes sure that the data get sent.
In all of the samples, the SmtpClient is deleted right after the quit() command, and the instance is not reused. The proposed changes implement the QUIT command fully and allow waiting for the server to close the connection. Critical variables are reset so that the connection can be reopened later.
The QTimer in SmtpClient::waitForEvent() was getting destroyed right after starting it, so that a timeout could never happen. Moving the instantiation to before the initialization scope solves that.
Flushing the socket stream after writing instead of before writing to it makes sure that the data get sent.