home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / examples / network / mail / smtp.h < prev   
Encoding:
C/C++ Source or Header  |  2001-10-11  |  1.1 KB  |  60 lines

  1. /****************************************************************************
  2. ** $Id:  qt/smtp.h   3.0.0   edited Jun 1 18:44 $
  3. **
  4. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  5. **
  6. ** This file is part of an example program for Qt.  This example
  7. ** program may be used, distributed and modified without limitation.
  8. **
  9. *****************************************************************************/
  10.  
  11. #ifndef SMTP_H
  12. #define SMTP_H
  13.  
  14. #include <qobject.h>
  15. #include <qstring.h>
  16.  
  17. class QSocket;
  18. class QTextStream;
  19. class QDns;
  20.  
  21. class Smtp : public QObject
  22. {
  23.     Q_OBJECT
  24.  
  25. public:
  26.     Smtp( const QString &from, const QString &to,
  27.       const QString &subject, const QString &body );
  28.     ~Smtp();
  29.  
  30. signals:
  31.     void status( const QString & );
  32.  
  33. private slots:
  34.     void dnsLookupHelper();
  35.     void readyRead();
  36.     void connected();
  37.  
  38. private:
  39.     enum State {
  40.     Init,
  41.     Mail,
  42.     Rcpt,
  43.     Data,
  44.     Body,
  45.     Quit,
  46.     Close
  47.     };
  48.  
  49.     QString message;
  50.     QString from;
  51.     QString rcpt;
  52.     QSocket *socket;
  53.     QTextStream * t;
  54.     int state;
  55.     QString response;
  56.     QDns * mxLookup;
  57. };
  58.  
  59. #endif
  60.