sock/zz_mail.h

Go to the documentation of this file.
00001 /* libzzsock
00002  *
00003  * This program is distributed under the GNU General Public License, version 2.
00004  * A copy of this license is included with this source.
00005  *
00006  * Copyright 2000-2006, Toni Thomsson <toni@tonjac.org> 
00007 */
00008 
00009 #ifndef zz_mail_h
00010 #define zz_mail_h
00011 
00012 #include <zz_export.h>
00013 
00014 #ifdef _WIN32
00015         #pragma warning(disable: 4786) // Debugsymbols truncated
00016         #pragma warning(disable: 4251) // DLL-interface missing for private map members
00017 #endif
00018 
00019 #include <zz_string.h>
00020 #include <zz_socket.h>
00021 #include <map>
00022 
00023 /*
00024         Description:
00025         Enkelt SMTP mail
00026 
00027         Author: 
00028         Toni Thomsson, toni@tonjac.org
00029 
00030         Library:
00031         libzzsock.a (HPUX) libzzsock.lib (win32)
00032 
00033         Platform:
00034         HPUX, win32
00035 */
00036 class ZZ_API CzzMail
00037 {
00038 public:
00039 
00040         /*
00041                 Description:
00042                 Skapar ett mail
00043 
00044                 Throws:
00045                 CzzException
00046         */
00047         CzzMail( const char* host,                                      // IN, mail host
00048                                 const char* sender,                             // IN, avsändare
00049                                 const char* recipient,                  // IN, mottagare
00050                                 const char* subject,                    // IN, rubrik
00051                                 const char* sendername = "",    // IN, avsändare (klartext)
00052                                 const char* recipientname = "", // IN, mottagare (klartext)
00053                                 const char* replyto = "",               // IN, svarsmottagare
00054                                 const char* replytoname = "",   // IN, svarsmottagare (klartext)
00055                                 const char* msgid = "" );               // IN, meddelande id
00056 
00057         virtual ~CzzMail();
00058 
00059         /*
00060                 Description:
00061                 Lägger till en textrad till meddelandet
00062         */
00063         void addMessageRow( const CzzString& row 
00064                                                 );
00065 
00066         /*
00067                 Description:
00068                 Kopplar en fil till meddelandet
00069 
00070                 Remarks:
00071                 EJ IMPLEMENTERAD, FUNGERAR EJ !
00072         */
00073         void addAttachment( const CzzString& file // IN, sökväg till fil
00074                                                 ) {};
00075 
00076         /*
00077                 Description:
00078                 Sänder meddelandet
00079 
00080                 Throws:
00081                 CzzException
00082         */
00083         void sendMessage( void );
00084 
00085 protected:
00086 
00087         void checkReply( const char* replycode );
00088         void send( const char* buff );
00089         
00090         CzzString m_Host;
00091         CzzString m_Sender;
00092         CzzString m_SenderName;
00093         CzzString m_Recipient;
00094         CzzString m_RecipientName;
00095         CzzString m_ReplyTo;
00096         CzzString m_ReplyToName;
00097         CzzString m_MessageId;
00098         CzzString m_Subject;
00099         CzzSocket* m_Socket;
00100 
00101 private:
00102         map<int, CzzString > m_MessageRows;
00103 
00104 };
00105 
00106 #endif // zz_mail_h
00107 
00108 
00109 
00110 

Generated on Thu Sep 21 21:45:42 2006 for tonjac.org MINI/C++ library by  doxygen 1.4.6-NO