Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
qxtsmtp.h
Go to the documentation of this file.
1/****************************************************************************
2 **
3 ** Copyright (C) Qxt Foundation. Some rights reserved.
4 **
5 ** This file is part of the QxtWeb module of the Qxt library.
6 **
7 ** This library is free software; you can redistribute it and/or modify it
8 ** under the terms of the Common Public License, version 1.0, as published
9 ** by IBM, and/or under the terms of the GNU Lesser General Public License,
10 ** version 2.1, as published by the Free Software Foundation.
11 **
12 ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
13 ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
14 ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
15 ** FITNESS FOR A PARTICULAR PURPOSE.
16 **
17 ** You should have received a copy of the CPL and the LGPL along with this
18 ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files
19 ** included with the source distribution for more information.
20 ** If you did not receive a copy of the licenses, contact the Qxt Foundation.
21 **
22 ** <http://libqxt.org> <foundation@libqxt.org>
23 **
24 ****************************************************************************/
25#ifndef QXTSMTP_H
26#define QXTSMTP_H
27
28#include <QObject>
29#include <QHostAddress>
30#include <QString>
31
32#include "qxtglobal.h"
33#include "qxtmailmessage.h"
34
35class QTcpSocket;
36class QSslSocket;
37
38class QxtSmtpPrivate;
39class QXT_NETWORK_EXPORT QxtSmtp : public QObject
40{
41 Q_OBJECT
42public:
58
59 QxtSmtp(QObject* parent = 0);
60
61 QByteArray username() const;
62 void setUsername(const QByteArray& name);
63
64 QByteArray password() const;
65 void setPassword(const QByteArray& password);
66
67 int send(const QxtMailMessage& message);
68 int pendingMessages() const;
69
70 QTcpSocket* socket() const;
71 void connectToHost(const QString& hostName, quint16 port = 25);
72 void connectToHost(const QHostAddress& address, quint16 port = 25);
73 void disconnectFromHost();
74
75 bool startTlsDisabled() const;
76 void setStartTlsDisabled(bool disable);
77
78 QSslSocket* sslSocket() const;
79 void connectToSecureHost(const QString& hostName, quint16 port = 465);
80 void connectToSecureHost(const QHostAddress& address, quint16 port = 465);
81
82 bool hasExtension(const QString& extension);
83 QString extensionData(const QString& extension);
84
85Q_SIGNALS:
86 void connected();
88 void connectionFailed( const QByteArray & msg );
89 void encrypted();
91 void encryptionFailed( const QByteArray & msg );
94 void authenticationFailed( const QByteArray & msg );
95
96 void senderRejected(int mailID, const QString& address );
97 void senderRejected(int mailID, const QString& address, const QByteArray & msg );
98 void recipientRejected(int mailID, const QString& address );
99 void recipientRejected(int mailID, const QString& address, const QByteArray & msg );
100 void mailFailed(int mailID, int errorCode);
101 void mailFailed(int mailID, int errorCode, const QByteArray & msg);
102 void mailSent(int mailID);
103
104 void finished();
106
107private:
109};
110
111#endif // QXTSMTP_H
The QxtMailMessage class encapsulates an e-mail according to RFC 2822 and related specifications TODO...
Definition qxtmailmessage.h:38
Definition qxtsmtp_p.h:35
The QxtSmtp class implements the SMTP protocol for sending email.
Definition qxtsmtp.h:40
void encryptionFailed(const QByteArray &msg)
void mailFailed(int mailID, int errorCode, const QByteArray &msg)
void authenticationFailed()
SmtpError
Definition qxtsmtp.h:44
@ CommandNotImplemented
Definition qxtsmtp.h:49
@ NoRecipients
Definition qxtsmtp.h:46
@ UserNotLocal
Definition qxtsmtp.h:53
@ ParameterNotImplemented
Definition qxtsmtp.h:51
@ MessageTooLarge
Definition qxtsmtp.h:54
@ SyntaxError
Definition qxtsmtp.h:48
@ TransactionFailed
Definition qxtsmtp.h:56
@ NoError
Definition qxtsmtp.h:45
@ MailboxUnavailable
Definition qxtsmtp.h:52
@ BadSequence
Definition qxtsmtp.h:50
@ CommandUnrecognized
Definition qxtsmtp.h:47
@ InvalidMailboxName
Definition qxtsmtp.h:55
void senderRejected(int mailID, const QString &address)
void authenticationFailed(const QByteArray &msg)
void disconnected()
QxtSmtp(QObject *parent=0)
Definition qxtsmtp.cpp:47
void mailSent(int mailID)
void connectionFailed(const QByteArray &msg)
void senderRejected(int mailID, const QString &address, const QByteArray &msg)
void recipientRejected(int mailID, const QString &address, const QByteArray &msg)
void encrypted()
void finished()
void recipientRejected(int mailID, const QString &address)
void mailFailed(int mailID, int errorCode)
void encryptionFailed()
void connectionFailed()
void connected()
void authenticated()
#define QXT_NETWORK_EXPORT
Definition qxtglobal.h:72
#define QXT_DECLARE_PRIVATE(PUB)
Definition qxtglobal.h:145