00001 /***************************************************************************** 00002 * \file mi32/mail.h 00003 * \brief MAIL definitions 00004 * 00005 * \if NODOC 00006 * $Id: mail.h_v 1.8 2011/10/26 12:58:27 mju Exp $ 00007 * 00008 * $Log: mail.h_v $ 00009 * Revision 1.8 2011/10/26 12:58:27 mju 00010 * Remove redundant hdrs and fix dox. 00011 * 00012 * Revision 1.7 2009/09/14 20:01:50 bcolombe 00013 * Added SetAuthenticate 00014 * Added SetOutgoingServer 00015 * 00016 * Revision 1.2 2007/05/31 17:33:05 drb 00017 * Fixed header info 00018 * include mistringlist header 00019 * \endif 00020 */ 00021 00022 #ifndef INC_MI32_MAIL_H 00023 #define INC_MI32_MAIL_H 00024 00025 #ifndef INC_MI32_FILEPATHLIST_H 00026 #include <mi32/filepathlist.h> 00027 #endif 00028 00029 #ifndef INC_MI32_MISTRINGLIST_H 00030 #include <mi32/mistringlist.h> 00031 #endif 00032 00033 class MAIL { 00034 public: 00035 00036 #ifdef USE_MGUI 00038 MAIL (); 00039 00041 MAIL ( 00042 const MISTRING &recipient, 00043 const MISTRING &subject, 00044 const MISTRING &body 00045 ); 00046 00048 MAIL ( 00049 const MISTRING &recipient, 00050 const MISTRING &subject, 00051 const MISTRING &body, 00052 const MISTRING &sourcename, 00053 const MISTRING &sourceaddress 00054 ); 00055 00057 ~MAIL(); 00058 00060 ERRVALUE OpenMailClient(); 00061 00063 ERRVALUE SendMail(); 00064 00066 void SetRecipient ( 00067 MISTRING &recipient 00068 ); 00069 00073 void AddAttachment ( 00074 FILEPATH &attachment, 00075 MISTRING *attachmentname=0 00076 ); 00077 00079 void SetSubject ( 00080 MISTRING &subject 00081 ); 00082 00084 void SetBody ( 00085 MISTRING &body 00086 ); 00087 00089 void SetSourceAddress( 00090 MISTRING &sourceaddress 00091 ); 00092 00094 void SetSourceName ( 00095 MISTRING &sourcename 00096 ); 00097 00098 void SetOutgoingServer ( 00099 const MISTRING& server, 00100 INT32 port 00101 ) { m_outgoingserver = server; m_port = port;} 00102 00103 void SetAuthenticate ( 00104 const MISTRING& username, 00105 const MISTRING& password 00106 ) { m_username = username; m_password = password;} 00107 00108 #endif //end if use_mgui 00109 00113 static MISTRING MakeRFCSMTPCompatible ( 00114 const MISTRING &string 00115 ); 00116 00117 #ifdef USE_MGUI 00118 private: 00119 #ifndef GENERATING_DOXYGEN_OUTPUT 00120 struct ATTACHMENT { 00121 FILEPATH filepath; 00122 MISTRING name; 00123 }; 00124 00125 INT32 m_port; 00126 MISTRING m_recipient; 00127 MISTRING m_subject; 00128 MISTRING m_body; 00129 MISTRING m_fromname; 00130 MISTRING m_fromaddress; 00131 MISTRING m_username; 00132 MISTRING m_password; 00133 MISTRING m_outgoingserver; 00134 MISTRINGLIST m_dnsnameservers; 00135 MILIST<ATTACHMENT> m_attachments; 00136 00137 MISTRING MakeSMTPMessage(); 00138 00139 void AddDefaultDNSServers(); 00140 #endif // GENERATING_DOXYGEN_OUTPUT 00141 #endif//endif use mgui 00142 00143 }; 00144 00145 #endif
1.6.1