aboutsummaryrefslogtreecommitdiffstats
path: root/include/smtp
diff options
context:
space:
mode:
Diffstat (limited to 'include/smtp')
-rw-r--r--include/smtp/SmtpMime31
-rw-r--r--include/smtp/emailaddress.h63
-rw-r--r--include/smtp/mimeattachment.h51
-rw-r--r--include/smtp/mimecontentformatter.h43
-rw-r--r--include/smtp/mimefile.h63
-rw-r--r--include/smtp/mimehtml.h61
-rw-r--r--include/smtp/mimeinlinefile.h56
-rw-r--r--include/smtp/mimemessage.h110
-rw-r--r--include/smtp/mimemultipart.h71
-rw-r--r--include/smtp/mimepart.h110
-rw-r--r--include/smtp/mimetext.h62
-rw-r--r--include/smtp/quotedprintable.h39
-rw-r--r--include/smtp/smtpclient.h197
-rw-r--r--include/smtp/smtpexports.h10
14 files changed, 0 insertions, 967 deletions
diff --git a/include/smtp/SmtpMime b/include/smtp/SmtpMime
deleted file mode 100644
index 940996b8..00000000
--- a/include/smtp/SmtpMime
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef SMTPMIME_H
-#define SMTPMIME_H
-
-#include "smtpclient.h"
-#include "mimepart.h"
-#include "mimehtml.h"
-#include "mimeattachment.h"
-#include "mimemessage.h"
-#include "mimetext.h"
-#include "mimeinlinefile.h"
-#include "mimefile.h"
-
-#endif // SMTPMIME_H
diff --git a/include/smtp/emailaddress.h b/include/smtp/emailaddress.h
deleted file mode 100644
index 90e4c1e9..00000000
--- a/include/smtp/emailaddress.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef EMAILADDRESS_H
-#define EMAILADDRESS_H
-
-#include <QObject>
-
-#include "smtpexports.h"
-
-class SMTP_EXPORT EmailAddress : public QObject {
-Q_OBJECT
-public:
-
- /* [1] Constructors and Destructors */
-
- EmailAddress() = default;
-
- explicit EmailAddress(const QString &address, const QString &name = "");
-
- ~EmailAddress() override;
-
- /* [1] --- */
-
-
- /* [2] Getters and Setters */
- void setName(const QString &name);
-
- void setAddress(const QString &address);
-
- [[nodiscard]] const QString &getName() const;
-
- [[nodiscard]] const QString &getAddress() const;
-
- /* [2] --- */
-
-
-private:
-
- /* [3] Private members */
-
- QString name;
- QString address;
-
- /* [3] --- */
-};
-
-#endif // EMAILADDRESS_H
diff --git a/include/smtp/mimeattachment.h b/include/smtp/mimeattachment.h
deleted file mode 100644
index 6b98a65a..00000000
--- a/include/smtp/mimeattachment.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef MIMEATTACHMENT_H
-#define MIMEATTACHMENT_H
-
-#include <QFile>
-#include "mimepart.h"
-#include "mimefile.h"
-
-#include "smtpexports.h"
-
-class SMTP_EXPORT MimeAttachment : public MimeFile {
-Q_OBJECT
-public:
-
- /* [1] Constructors and Destructors */
-
- explicit MimeAttachment(QFile *file);
-
- MimeAttachment(const QByteArray &stream, const QString &fileName);
-
- ~MimeAttachment() override;
-
- /* [1] --- */
-
-protected:
-
- /* [2] Protected methods */
-
- void prepare() override;
-
- /* [2] --- */
-};
-
-#endif // MIMEATTACHMENT_H
diff --git a/include/smtp/mimecontentformatter.h b/include/smtp/mimecontentformatter.h
deleted file mode 100644
index e6e3637f..00000000
--- a/include/smtp/mimecontentformatter.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef MIMECONTENTFORMATTER_H
-#define MIMECONTENTFORMATTER_H
-
-#include <QObject>
-#include <QByteArray>
-
-#include "smtpexports.h"
-
-class SMTP_EXPORT MimeContentFormatter : public QObject {
-Q_OBJECT
-public:
- explicit MimeContentFormatter(int max_length = 76);
-
- void setMaxLength(int l);
-
- [[nodiscard]] int getMaxLength() const;
-
- [[nodiscard]] QString format(const QString &content, bool quotedPrintable = false) const;
-
-protected:
- int max_length;
-
-};
-
-#endif // MIMECONTENTFORMATTER_H
diff --git a/include/smtp/mimefile.h b/include/smtp/mimefile.h
deleted file mode 100644
index 46903da9..00000000
--- a/include/smtp/mimefile.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef MIMEFILE_H
-#define MIMEFILE_H
-
-#include "mimepart.h"
-#include <QFile>
-
-#include "smtpexports.h"
-
-class SMTP_EXPORT MimeFile : public MimePart {
-Q_OBJECT
-public:
-
- /* [1] Constructors and Destructors */
-
- MimeFile(const QByteArray &stream, const QString &fileName);
-
- explicit MimeFile(QFile *f);
-
- ~MimeFile() override;
-
- /* [1] --- */
-
-
- /* [2] Getters and Setters */
-
- /* [2] --- */
-
-protected:
-
- /* [3] Protected members */
-
- QFile *file;
-
- /* [3] --- */
-
-
- /* [4] Protected methods */
-
- void prepare() override;
-
- /* [4] --- */
-
-};
-
-#endif // MIMEFILE_H
diff --git a/include/smtp/mimehtml.h b/include/smtp/mimehtml.h
deleted file mode 100644
index 8ce8c454..00000000
--- a/include/smtp/mimehtml.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef MIMEHTML_H
-#define MIMEHTML_H
-
-#include "mimetext.h"
-
-#include "smtpexports.h"
-
-class SMTP_EXPORT MimeHtml : public MimeText {
-Q_OBJECT
-public:
-
- /* [1] Constructors and Destructors */
-
- explicit MimeHtml(const QString &html = "");
-
- ~MimeHtml() override;
-
- /* [1] --- */
-
-
- /* [2] Getters and Setters */
-
- void setHtml(const QString &html);
-
- [[nodiscard]] const QString &getHtml() const;
-
- /* [2] --- */
-
-protected:
-
- /* [3] Protected members */
-
- /* [3] --- */
-
-
- /* [4] Protected methods */
-
- void prepare() override;
-
- /* [4] --- */
-};
-
-#endif // MIMEHTML_H
diff --git a/include/smtp/mimeinlinefile.h b/include/smtp/mimeinlinefile.h
deleted file mode 100644
index 916f7b76..00000000
--- a/include/smtp/mimeinlinefile.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef MIMEINLINEFILE_H
-#define MIMEINLINEFILE_H
-
-#include "mimefile.h"
-
-#include "smtpexports.h"
-
-class SMTP_EXPORT MimeInlineFile : public MimeFile {
-public:
-
- /* [1] Constructors and Destructors */
-
- explicit MimeInlineFile(QFile *f);
-
- ~MimeInlineFile() override;
-
- /* [1] --- */
-
-
- /* [2] Getters and Setters */
-
- /* [2] --- */
-
-protected:
-
- /* [3] Protected members */
-
- /* [3] --- */
-
-
- /* [4] Protected methods */
-
- void prepare() override;
-
- /* [4] --- */
-};
-
-#endif // MIMEINLINEFILE_H
diff --git a/include/smtp/mimemessage.h b/include/smtp/mimemessage.h
deleted file mode 100644
index 24e4f108..00000000
--- a/include/smtp/mimemessage.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef MIMEMESSAGE_H
-#define MIMEMESSAGE_H
-
-#include "mimepart.h"
-#include "mimemultipart.h"
-#include "emailaddress.h"
-#include <QList>
-
-#include "smtpexports.h"
-
-class SMTP_EXPORT MimeMessage : public QObject {
-public:
-
- enum RecipientType {
- To, // primary
- Cc, // carbon copy
- Bcc // blind carbon copy
- };
-
- /* [1] Constructors and Destructors */
-
- explicit MimeMessage(bool createAutoMimeConent = true);
-
- ~MimeMessage() override;
-
- /* [1] --- */
-
-
- /* [2] Getters and Setters */
-
- void setSender(EmailAddress *e);
-
- void addRecipient(EmailAddress *rcpt, RecipientType type = To);
-
- void addTo(EmailAddress *rcpt);
-
- void addCc(EmailAddress *rcpt);
-
- void addBcc(EmailAddress *rcpt);
-
- void setSubject(const QString &subject);
-
- void addPart(MimePart *part);
-
- void setReplyTo(EmailAddress *rto);
-
- void setInReplyTo(const QString &inReplyTo);
-
- void setHeaderEncoding(MimePart::Encoding);
-
- [[nodiscard]] const EmailAddress &getSender() const;
-
- [[nodiscard]] const QList<EmailAddress *> &getRecipients(RecipientType type = To) const;
-
- [[nodiscard]] const QString &getSubject() const;
-
- [[nodiscard]] const QList<MimePart *> &getParts() const;
-
- [[nodiscard]] const EmailAddress *getReplyTo() const;
-
- MimePart &getContent();
-
- void setContent(MimePart *content);
- /* [2] --- */
-
-
- /* [3] Public methods */
-
- virtual QString toString();
-
- /* [3] --- */
-
-protected:
-
- /* [4] Protected members */
-
- EmailAddress *sender{};
- EmailAddress *replyTo;
- QList<EmailAddress *> recipientsTo, recipientsCc, recipientsBcc;
- QString subject;
- QString mInReplyTo;
- MimePart *content;
- bool autoMimeContentCreated;
-
- MimePart::Encoding hEncoding;
-
- /* [4] --- */
-
-
-};
-
-#endif // MIMEMESSAGE_H
diff --git a/include/smtp/mimemultipart.h b/include/smtp/mimemultipart.h
deleted file mode 100644
index b829a66f..00000000
--- a/include/smtp/mimemultipart.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef MIMEMULTIPART_H
-#define MIMEMULTIPART_H
-
-#include "mimepart.h"
-
-#include "smtpexports.h"
-
-class SMTP_EXPORT MimeMultiPart : public MimePart {
-Q_OBJECT
-public:
- /* [0] Enums */
- enum MultiPartType {
- Mixed = 0, // RFC 2046, section 5.1.3
- Digest = 1, // RFC 2046, section 5.1.5
- Alternative = 2, // RFC 2046, section 5.1.4
- Related = 3, // RFC 2387
- Report = 4, // RFC 6522
- Signed = 5, // RFC 1847, section 2.1
- Encrypted = 6 // RFC 1847, section 2.2
- };
-
- /* [0] --- */
-
- /* [1] Constructors and Destructors */
- explicit MimeMultiPart(MultiPartType type = Related);
-
- /* [1] --- */
-
- /* [2] Getters and Setters */
-
- void setMimeType(MultiPartType type);
-
- [[nodiscard]] MultiPartType getMimeType() const;
-
- [[nodiscard]] const QList<MimePart *> &getParts() const;
-
- /* [2] --- */
-
- /* [3] Public methods */
-
- void addPart(MimePart *part);
-
- void prepare() override;
-
- /* [3] --- */
-
-protected:
- QList<MimePart *> parts;
-
- MultiPartType type;
-};
-
-#endif // MIMEMULTIPART_H
diff --git a/include/smtp/mimepart.h b/include/smtp/mimepart.h
deleted file mode 100644
index 1a1386de..00000000
--- a/include/smtp/mimepart.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef MIMEPART_H
-#define MIMEPART_H
-
-#include "mimecontentformatter.h"
-#include <QObject>
-
-#include "smtpexports.h"
-
-class SMTP_EXPORT MimePart : public QObject {
-Q_OBJECT
-public:
- /* [0] Enumerations */
- enum Encoding {
- _7Bit, _8Bit, Base64, QuotedPrintable
- };
-
- /* [0] --- */
-
- /* [1] Constructors and Destructors */
-
- MimePart();
-
- ~MimePart() = default;
-
- /* [1] --- */
-
- /* [2] Getters and Setters */
-
- [[nodiscard]] const QString &getHeader() const;
-
- [[nodiscard]] const QByteArray &getContent() const;
-
- void setContent(const QByteArray &content);
-
- void setHeader(const QString &header);
-
- void addHeaderLine(const QString &line);
-
- void setContentId(const QString &cId);
-
- [[nodiscard]] const QString &getContentId() const;
-
- void setContentName(const QString &cName);
-
- [[nodiscard]] const QString &getContentName() const;
-
- void setContentType(const QString &cType);
-
- [[nodiscard]] const QString &getContentType() const;
-
- void setCharset(const QString &charset);
-
- [[nodiscard]] const QString &getCharset() const;
-
- void setEncoding(Encoding enc);
-
- [[nodiscard]] Encoding getEncoding() const;
-
- MimeContentFormatter &getContentFormatter();
-
- /* [2] --- */
-
- /* [3] Public methods */
-
- virtual QString toString();
-
- virtual void prepare();
-
- /* [3] --- */
-
-protected:
- /* [4] Protected members */
-
- QString header;
- QByteArray content;
-
- QString cId;
- QString cName;
- QString cType;
- QString cCharset;
- QString cBoundary;
- Encoding cEncoding;
-
- QString mimeString;
- bool prepared;
-
- MimeContentFormatter formatter;
-
- /* [4] --- */
-};
-
-#endif // MIMEPART_H
diff --git a/include/smtp/mimetext.h b/include/smtp/mimetext.h
deleted file mode 100644
index c21a1c5e..00000000
--- a/include/smtp/mimetext.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef MIMETEXT_H
-#define MIMETEXT_H
-
-#include "mimepart.h"
-
-#include "smtpexports.h"
-
-class SMTP_EXPORT MimeText : public MimePart {
-public:
-
- /* [1] Constructors and Destructors */
-
- explicit MimeText(const QString &text = "");
-
- ~MimeText() override;
-
- /* [1] --- */
-
-
- /* [2] Getters and Setters*/
-
- void setText(const QString &text);
-
- [[nodiscard]] const QString &getText() const;
-
- /* [2] --- */
-
-protected:
-
- /* [3] Protected members */
-
- QString text;
- /* [3] --- */
-
-
- /* [4] Protected methods */
-
- void prepare() override;
-
- /* [4] --- */
-
-};
-
-#endif // MIMETEXT_H
diff --git a/include/smtp/quotedprintable.h b/include/smtp/quotedprintable.h
deleted file mode 100644
index 00ca3cf8..00000000
--- a/include/smtp/quotedprintable.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef QUOTEDPRINTABLE_H
-#define QUOTEDPRINTABLE_H
-
-#include <QObject>
-#include <QByteArray>
-
-#include "smtpexports.h"
-
-class SMTP_EXPORT QuotedPrintable : public QObject {
-Q_OBJECT
-public:
-
- static QString encode(const QByteArray &input);
-
- static QByteArray decode(const QString &input);
-
-private:
- QuotedPrintable();
-};
-
-#endif // QUOTEDPRINTABLE_H
diff --git a/include/smtp/smtpclient.h b/include/smtp/smtpclient.h
deleted file mode 100644
index 29c507dc..00000000
--- a/include/smtp/smtpclient.h
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- Copyright (c) 2011-2012 - Tőkés Attila
-
- This file is part of SmtpClient for Qt.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- See the LICENSE file for more details.
-*/
-
-#ifndef SMTPCLIENT_H
-#define SMTPCLIENT_H
-
-#include <QObject>
-#include <QtNetwork/QSslSocket>
-
-#include "mimemessage.h"
-#include "smtpexports.h"
-
-class SMTP_EXPORT SmtpClient : public QObject {
-Q_OBJECT
-public:
-
- /* [0] Enumerations */
-
- enum AuthMethod {
- AuthPlain,
- AuthLogin
- };
-
- enum SmtpError {
- ConnectionTimeoutError,
- ResponseTimeoutError,
- SendDataTimeoutError,
- AuthenticationFailedError,
- ServerError, // 4xx smtp error
- ClientError // 5xx smtp error
- };
-
- enum ConnectionType {
- TcpConnection,
- SslConnection,
- TlsConnection // STARTTLS
- };
-
- /* [0] --- */
-
-
- /* [1] Constructors and Destructors */
-
- explicit SmtpClient(const QString &host = "localhost", int port = 25, ConnectionType ct = TcpConnection);
-
- ~SmtpClient() override;
-
- /* [1] --- */
-
-
- /* [2] Getters and Setters */
-
- [[nodiscard]] const QString &getHost() const;
-
- void setHost(const QString &host);
-
- [[nodiscard]] int getPort() const;
-
- void setPort(int port);
-
- [[nodiscard]] const QString &getName() const;
-
- void setName(const QString &name);
-
- [[nodiscard]] ConnectionType getConnectionType() const;
-
- void setConnectionType(ConnectionType ct);
-
- [[nodiscard]] const QString &getUser() const;
-
- void setUser(const QString &user);
-
- [[nodiscard]] const QString &getPassword() const;
-
- void setPassword(const QString &password);
-
- [[nodiscard]] SmtpClient::AuthMethod getAuthMethod() const;
-
- void setAuthMethod(AuthMethod method);
-
- [[nodiscard]] const QString &getResponseText() const;
-
- [[nodiscard]] int getResponseCode() const;
-
- [[nodiscard]] int getConnectionTimeout() const;
-
- void setConnectionTimeout(int msec);
-
- [[nodiscard]] int getResponseTimeout() const;
-
- void setResponseTimeout(int msec);
-
- [[nodiscard]] int getSendMessageTimeout() const;
-
- void setSendMessageTimeout(int msec);
-
- QTcpSocket *getSocket();
-
-
- /* [2] --- */
-
-
- /* [3] Public methods */
-
- bool connectToHost();
-
- bool login();
-
- bool login(const QString &user, const QString &password, AuthMethod method = AuthLogin);
-
- bool sendMail(MimeMessage &email);
-
- void quit();
-
-
- /* [3] --- */
-
-protected:
-
- /* [4] Protected members */
-
- QTcpSocket *socket;
-
- QString host;
- int port;
- ConnectionType connectionType;
- QString name;
-
- QString user;
- QString password;
- AuthMethod authMethod;
-
- int connectionTimeout;
- int responseTimeout;
- int sendMessageTimeout;
-
-
- QString responseText;
- int responseCode;
-
-
- class ResponseTimeoutException : public std::exception {
- };
-
- class SendMessageTimeoutException : public std::exception {
- };
-
- /* [4] --- */
-
-
- /* [5] Protected methods */
-
- void waitForResponse();
-
- void sendMessage(const QString &text);
-
- /* [5] --- */
-
-protected slots:
-
- /* [6] Protected slots */
-
- void socketStateChanged(QAbstractSocket::SocketState state);
-
- void socketError(QAbstractSocket::SocketError error);
-
- void socketReadyRead();
-
- /* [6] --- */
-
-
-signals:
-
- /* [7] Signals */
-
- void smtpError(SmtpClient::SmtpError e);
-
- /* [7] --- */
-
-};
-
-#endif // SMTPCLIENT_H
diff --git a/include/smtp/smtpexports.h b/include/smtp/smtpexports.h
deleted file mode 100644
index 9ca12bae..00000000
--- a/include/smtp/smtpexports.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef SMTPEXPORTS_H
-#define SMTPEXPORTS_H
-
-#ifdef SMTP_BUILD
-#define SMTP_EXPORT
-#else
-#define SMTP_EXPORT
-#endif
-
-#endif // SMTPEXPORTS_H