diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bd9e6617827818fd043452c08c606f07b78014a0 (patch) | |
tree | 425bb4c3168f9c02f10150f235d2cb998dcc6108 /kbugbuster/backend/smtp.h | |
download | tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbugbuster/backend/smtp.h')
-rw-r--r-- | kbugbuster/backend/smtp.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/kbugbuster/backend/smtp.h b/kbugbuster/backend/smtp.h new file mode 100644 index 00000000..d800cb77 --- /dev/null +++ b/kbugbuster/backend/smtp.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** This file is a modified version of part of an example program for Qt. +** This file may be used, distributed and modified without limitation. +** +** Don Sanders <sanders@kde.org> +** +*****************************************************************************/ + +#ifndef SMTP_H +#define SMTP_H + +#include <qobject.h> +#include <qstring.h> +#include <qstringlist.h> + +class QSocket; +class QTextStream; + +class Smtp : public QObject +{ + Q_OBJECT + +public: + Smtp( const QString &from, const QStringList &to, const QString &message, + const QString &server, unsigned short int port = 25 ); + ~Smtp(); + void send( const QString &, const QStringList &, const QString & ); + void quit(); + + +signals: + void success(); + void status( const QString & ); + void error( const QString &command, const QString &response ); + +private slots: + void readyRead(); + void connected(); + void deleteMe(); + void socketError(int err); + void emitError(); + +private: + enum State { + smtpInit, + smtpMail, + smtpRcpt, + smtpData, + smtpBody, + smtpSuccess, + smtpQuit, + smtpClose + }; + + QString message; + QString from; + QStringList rcpt; + QSocket *mSocket; + QTextStream * t; + int state; + QString response, responseLine; + bool skipReadResponse; + QString command; +}; + +#endif |