home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 93win / data1.cab / DLL_Toolkit / Source / HTBMail / IMapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-03-02  |  1.1 KB  |  53 lines

  1. /*************************************************************
  2. HTBmail.dll
  3.  
  4. Copyright 1999 TransEra Corporation
  5.  
  6. htbmail.cpp  
  7.       
  8. With help from http://www.codeguru.com/internet/imapi.shtml 
  9. *************************************************************/
  10. class CIMapi
  11. {
  12. public:
  13.                     CIMapi();
  14.                     ~CIMapi();
  15.  
  16.     enum errorCodes
  17.     {
  18.         IMAPI_SUCCESS = 0,
  19.         IMAPI_LOADFAILED,
  20.         IMAPI_INVALIDDLL,
  21.         IMAPI_FAILTO,
  22.         IMAPI_FAILCC,
  23.         IMAPI_FAILATTACH
  24.     };
  25.  
  26.     void            Subject(LPCTSTR subject)    { m_message.lpszSubject = (LPTSTR) subject; }
  27.     void            Text(LPCTSTR text)            { m_text = text; }
  28.  
  29.     UINT            Error();
  30.     void            From(LPCTSTR from)            { m_from.lpszName = (LPTSTR) from; }
  31.  
  32.     static BOOL        HasEmail();
  33.  
  34.     BOOL            To(LPCTSTR recip);
  35.     BOOL            Cc(LPCTSTR recip);
  36.     BOOL            Attach(LPCTSTR path, LPCTSTR name = NULL);
  37.     
  38.     BOOL            Send(ULONG flags = 0);
  39.  
  40. private:
  41.     BOOL            AllocNewTo();
  42.  
  43.     MapiMessage        m_message;
  44.     MapiRecipDesc    m_from;
  45.     UINT            m_error;
  46.     CString            m_text;
  47.  
  48.     ULONG (PASCAL *m_lpfnSendMail)(ULONG, ULONG, MapiMessage*, FLAGS, ULONG);
  49.     
  50.     static HINSTANCE m_hInstMail;
  51.     static BOOL        m_isMailAvail;
  52. };
  53.