diff --git a/src/mimeattachment.h b/src/mimeattachment.h index 9fa6d61..39c17ac 100644 --- a/src/mimeattachment.h +++ b/src/mimeattachment.h @@ -37,7 +37,7 @@ protected: /* [2] Protected methods */ - void prepare(); + virtual void prepare(); /* [2] --- */ }; diff --git a/src/mimefile.h b/src/mimefile.h index 4db958b..d38a219 100644 --- a/src/mimefile.h +++ b/src/mimefile.h @@ -48,7 +48,7 @@ protected: /* [4] Protected methods */ - void prepare(); + virtual void prepare(); /* [4] --- */ diff --git a/src/mimehtml.h b/src/mimehtml.h index a4bf608..e5e197a 100644 --- a/src/mimehtml.h +++ b/src/mimehtml.h @@ -49,7 +49,7 @@ protected: /* [4] Protected methods */ - void prepare(); + virtual void prepare(); /* [4] --- */ }; diff --git a/src/mimeinlinefile.h b/src/mimeinlinefile.h index 00766a3..4e6b84f 100644 --- a/src/mimeinlinefile.h +++ b/src/mimeinlinefile.h @@ -44,7 +44,7 @@ protected: /* [4] Protected methods */ - void prepare(); + virtual void prepare(); /* [4] --- */ }; diff --git a/src/mimemessage.cpp b/src/mimemessage.cpp index 2be4fab..f7a1a54 100644 --- a/src/mimemessage.cpp +++ b/src/mimemessage.cpp @@ -21,7 +21,8 @@ /* [1] Constructors and Destructors */ -MimeMessage::MimeMessage() +MimeMessage::MimeMessage() : + hEncoding(MimePart::_8Bit) { } diff --git a/src/mimemessage.h b/src/mimemessage.h index 0d46490..8a82ceb 100644 --- a/src/mimemessage.h +++ b/src/mimemessage.h @@ -52,7 +52,7 @@ public: /* [3] Public methods */ - QString toString(); + virtual QString toString(); /* [3] --- */ diff --git a/src/mimepart.h b/src/mimepart.h index 617cc26..3b07644 100644 --- a/src/mimepart.h +++ b/src/mimepart.h @@ -74,7 +74,7 @@ public: /* [3] Public methods */ - QString toString(); + virtual QString toString(); virtual void prepare(); diff --git a/src/smtpclient.cpp b/src/smtpclient.cpp index 30c435a..80489c3 100644 --- a/src/smtpclient.cpp +++ b/src/smtpclient.cpp @@ -23,6 +23,7 @@ /* [1] Constructors and destructors */ SmtpClient::SmtpClient(const QString & host, int port, ConnectionType ct) : + name("localhost"), authMethod(AuthPlain), connectionTimeout(5000), responseTimeout(5000) @@ -126,6 +127,16 @@ SmtpClient::ConnectionType SmtpClient::getConnectionType() const return TcpConnection; } +const QString& SmtpClient::getName() const +{ + return this->name; +} + +void SmtpClient::setName(const QString &name) +{ + this->name = name; +} + /* [2] --- */ @@ -160,7 +171,7 @@ bool SmtpClient::connectToHost() // Send a EHLO/HELO message to the server // The client's first command must be EHLO/HELO - sendMessage("EHLO SmtpClient for Qt/C++"); + sendMessage("EHLO " + name); // Wait for the server's response waitForResponse(); diff --git a/src/smtpclient.h b/src/smtpclient.h index bddb620..07d5815 100644 --- a/src/smtpclient.h +++ b/src/smtpclient.h @@ -71,6 +71,9 @@ public: int getPort() const; void setPort(int port); + const QString& getName() const; + void setName(const QString &name); + ConnectionType getConnectionType() const; void setConnectionType(ConnectionType ct); @@ -97,6 +100,7 @@ public: void quit(); + /* [3] --- */ protected: @@ -108,6 +112,7 @@ protected: QString host; int port; bool useSsl; + QString name; QString user; QString password; @@ -119,6 +124,7 @@ protected: QString responseText; int responseCode; + class ResponseTimeoutException {}; /* [4] --- */