Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
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
35
class
QTcpSocket;
36
class
QSslSocket;
37
38
class
QxtSmtpPrivate
;
39
class
QXT_NETWORK_EXPORT
QxtSmtp
:
public
QObject
40
{
41
Q_OBJECT
42
public
:
43
enum
SmtpError
44
{
45
NoError
,
46
NoRecipients
,
47
CommandUnrecognized
= 500,
48
SyntaxError
,
49
CommandNotImplemented
,
50
BadSequence
,
51
ParameterNotImplemented
,
52
MailboxUnavailable
= 550,
53
UserNotLocal
,
54
MessageTooLarge
,
55
InvalidMailboxName
,
56
TransactionFailed
57
};
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
void
clearPending();
70
void
reset();
71
72
QTcpSocket* socket()
const
;
73
void
connectToHost(
const
QString& hostName, quint16 port = 25);
74
void
connectToHost(
const
QHostAddress& address, quint16 port = 25);
75
void
disconnectFromHost();
76
77
bool
startTlsDisabled()
const
;
78
void
setStartTlsDisabled(
bool
disable);
79
80
QSslSocket* sslSocket()
const
;
81
void
connectToSecureHost(
const
QString& hostName, quint16 port = 465);
82
void
connectToSecureHost(
const
QHostAddress& address, quint16 port = 465);
83
84
bool
hasExtension(
const
QString& extension);
85
QString extensionData(
const
QString& extension);
86
87
Q_SIGNALS:
88
void
connected
();
89
void
connectionFailed
();
90
void
connectionFailed
(
const
QByteArray & msg );
91
void
encrypted
();
92
void
encryptionFailed
();
93
void
encryptionFailed
(
const
QByteArray & msg );
94
void
authenticated
();
95
void
authenticationFailed
();
96
void
authenticationFailed
(
const
QByteArray & msg );
97
98
void
senderRejected
(
int
mailID,
const
QString& address );
99
void
senderRejected
(
int
mailID,
const
QString& address,
const
QByteArray & msg );
100
void
recipientRejected
(
int
mailID,
const
QString& address );
101
void
recipientRejected
(
int
mailID,
const
QString& address,
const
QByteArray & msg );
102
void
mailFailed
(
int
mailID,
int
errorCode);
103
void
mailFailed
(
int
mailID,
int
errorCode,
const
QByteArray & msg);
104
void
mailSent
(
int
mailID);
105
106
void
finished
();
107
void
disconnected
();
108
109
private
:
110
QXT_DECLARE_PRIVATE
(
QxtSmtp
)
111
};
112
113
#endif
// QXTSMTP_H
QxtMailMessage
The QxtMailMessage class encapsulates an e-mail according to RFC 2822 and related specifications.
Definition
qxtmailmessage.h:38
QxtSmtpPrivate
Definition
qxtsmtp_p.h:35
QxtSmtp::encryptionFailed
void encryptionFailed(const QByteArray &msg)
QxtSmtp::mailFailed
void mailFailed(int mailID, int errorCode, const QByteArray &msg)
QxtSmtp::authenticationFailed
void authenticationFailed()
QxtSmtp::SmtpError
SmtpError
Definition
qxtsmtp.h:44
QxtSmtp::CommandNotImplemented
@ CommandNotImplemented
Definition
qxtsmtp.h:49
QxtSmtp::NoRecipients
@ NoRecipients
Definition
qxtsmtp.h:46
QxtSmtp::UserNotLocal
@ UserNotLocal
Definition
qxtsmtp.h:53
QxtSmtp::ParameterNotImplemented
@ ParameterNotImplemented
Definition
qxtsmtp.h:51
QxtSmtp::MessageTooLarge
@ MessageTooLarge
Definition
qxtsmtp.h:54
QxtSmtp::SyntaxError
@ SyntaxError
Definition
qxtsmtp.h:48
QxtSmtp::TransactionFailed
@ TransactionFailed
Definition
qxtsmtp.h:56
QxtSmtp::NoError
@ NoError
Definition
qxtsmtp.h:45
QxtSmtp::MailboxUnavailable
@ MailboxUnavailable
Definition
qxtsmtp.h:52
QxtSmtp::BadSequence
@ BadSequence
Definition
qxtsmtp.h:50
QxtSmtp::CommandUnrecognized
@ CommandUnrecognized
Definition
qxtsmtp.h:47
QxtSmtp::InvalidMailboxName
@ InvalidMailboxName
Definition
qxtsmtp.h:55
QxtSmtp::senderRejected
void senderRejected(int mailID, const QString &address)
QxtSmtp::authenticationFailed
void authenticationFailed(const QByteArray &msg)
QxtSmtp::disconnected
void disconnected()
QxtSmtp::QxtSmtp
QxtSmtp(QObject *parent=0)
Definition
qxtsmtp.cpp:47
QxtSmtp::mailSent
void mailSent(int mailID)
QxtSmtp::connectionFailed
void connectionFailed(const QByteArray &msg)
QxtSmtp::senderRejected
void senderRejected(int mailID, const QString &address, const QByteArray &msg)
QxtSmtp::recipientRejected
void recipientRejected(int mailID, const QString &address, const QByteArray &msg)
QxtSmtp::encrypted
void encrypted()
QxtSmtp::finished
void finished()
QxtSmtp::recipientRejected
void recipientRejected(int mailID, const QString &address)
QxtSmtp::mailFailed
void mailFailed(int mailID, int errorCode)
QxtSmtp::encryptionFailed
void encryptionFailed()
QxtSmtp::connectionFailed
void connectionFailed()
QxtSmtp::connected
void connected()
QxtSmtp::authenticated
void authenticated()
qxtglobal.h
QXT_NETWORK_EXPORT
#define QXT_NETWORK_EXPORT
Definition
qxtglobal.h:72
QXT_DECLARE_PRIVATE
#define QXT_DECLARE_PRIVATE(PUB)
Definition
qxtglobal.h:145
qxtmailmessage.h
servatrice
src
smtp
qxtsmtp.h
Generated by
1.18.0