1 // HwSMTP.h: interface for the CHwSMTP class.
3 //////////////////////////////////////////////////////////////////////
5 /*******************************************************************
7 1¡¢ÕâÊÇÎÒ×Ô¼ºÐ´µÄÒ»¸öÀûÓÃSMTP·þÎñÆ÷·¢ËÍÓʼþµÄÀ࣬¿ÉÒÔʵÏÖ¸½¼þµÄ
9 2¡¢ÔÚ InitInstance() º¯Êýµ÷ÓÃ
12 AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
15 ÔÚ ExitInstance () Öе÷Óà ::WSACleanup ();
16 *******************************************************************/
18 /****************************************************************************************************************
20 ****************************************************************************************************************/
21 #define NOTE_SpeedPostMail \
24 ÎÞÐëSMTP·þÎñÆ÷ÖÐתֱ½Ó½«E-Mailµç×ÓÓʼþ·¢Ë͵½¶Ô·½ÓÊÏä\r\n\
30 лºìΰ ¡¤ chrys ¡¤ chrys@163.com ¡¤ http://www.viction.net\r\n\
32 ´ó¼ÒÒ»¶¨ÊìϤFoxmailÖеġ°ÌØ¿ìרµÝ¡±£¬ËüÄÜÖ±½Ó½«Óʼþ·¢Ë͵½¶Ô·½µÄÓʼþ·þÎñÆ÷ÖУ¬¶ø²»ÐèÒª¾¹ýSMTP·þÎñÆ÷ÖÐת£¬\
33 ±¾´úÂ뽫ÏòÄãÆÊÎö¡°ÌØ¿ìרµÝ¡±·¢Ë͵ç×ÓÓʼþµÄ·½·¨¡£´úÂëÖÐÌṩÁËÍø¿¨ÐÅÏ¢»ñÈ¡À࣬¿ÉÒÔ»ñÈ¡±¾»úIPµØÖ·¡¢×ÓÍøÑÚÂë¡¢DNS¡¢\
34 Wins¡¢Íø¿¨MACµØÖ·µÈÏà¹ØÐÅÏ¢£»»¹ÌṩÁËSMTPÐÒé½âÎöÀ࣬¸ÃÀàʵÏÖÁËSMTP¿Í»§¶Ë¹¦ÄܵÄʵÏÖÀ࣬ʵÏÖµç×ÓÓʼþÊÕ·¢£»Base64±àÂëʵÏÖ\
35 ÁË×Ö·û±àÂëµÄ·½·¨¡£\r\n\
36 Äã¿ÉÒÔÈÎÒâÐ޸ĸ´ÖƱ¾´úÂ룬µ«Çë±£ÁôÕâ¶ÎÎÄ×Ö²»ÒªÐ޸ġ£\r\n\
37 Ï£ÍûÎÒÄÜΪÖйúµÄÈí¼þÐÐÒµ¾¡Ò»·Ý±¡Á¦£¡\r\n\
43 #if !defined(AFX_HwSMTP_H__633A52B7_1CBE_41D7_BDA3_188D98D692AF__INCLUDED_)
44 #define AFX_HwSMTP_H__633A52B7_1CBE_41D7_BDA3_188D98D692AF__INCLUDED_
48 #endif // _MSC_VER > 1000
53 CString
GetLastErrorText();
55 LPCTSTR lpszSmtpSrvHost
,
63 LPCTSTR lpszCharSet
, // ×Ö·û¼¯ÀàÐÍ£¬ÀýÈ磺·±ÌåÖÐÎÄÕâÀïÓ¦ÊäÈë"big5"£¬¼òÌåÖÐÎÄʱÊäÈë"gb2312"
64 CStringArray
*pStrAryAttach
=NULL
,
65 LPCTSTR pStrAryCC
=NULL
,
68 LPCTSTR pToList
= NULL
76 LPCTSTR lpszCharSet
, // ×Ö·û¼¯ÀàÐÍ£¬ÀýÈ磺·±ÌåÖÐÎÄÕâÀïÓ¦ÊäÈë"big5"£¬¼òÌåÖÐÎÄʱÊäÈë"gb2312"
77 CStringArray
*pStrAryAttach
=NULL
,
78 LPCTSTR pStrAryCC
=NULL
,
86 CString
GetServerAddress(CString
&email
);
87 void GetNameAddress(CString
&in
, CString
&name
,CString
&address
);
95 BOOL
Send ( CString
&data
);
96 BOOL
SendBuffer(char *buffer
,int size
=-1);
97 BOOL
GetResponse( LPCTSTR lpszVerifyCode
, int *pnCode
=NULL
);
100 CStringArray m_StrAryAttach
;
101 CString m_csSmtpSrvHost
;
102 CString m_csUserName
;
104 CString m_csAddrFrom
;
106 CString m_csFromName
;
107 CString m_csReceiverName
;
118 CString m_csLastError
;
119 BOOL
SendOnAttach(LPCTSTR lpszFileName
);
122 CString m_csMIMEContentType
;
123 CString m_csPartBoundary
;
124 CString m_csNoMIMEText
;
129 BOOL bViaThreadSend
, // FALSE - Ö±½Ó·¢ËÍ£¬ TRUE - ÔÚÏß³ÌÖз¢ËÍ£¬·µ»ØÏ߳̾ä±ú
130 LPCTSTR lpszSmtpSrvHost
, // SMTP ·þÎñÆ÷£¬È磺smtp.21cn.com
131 LPCTSTR lpszUserName
, // µÇ¼·þÎñÆ÷ÑéÖ¤Éí·ÝµÄÓû§Ãû
132 LPCTSTR lpszPasswd
, // µÇ¼·þÎñÆ÷ÑéÖ¤Éí·ÝµÄÃÜÂë
133 BOOL bMustAuth
, // SMTP ·þÎñÆ÷ÐèÒªÉí·ÝÑéÖ¤
134 LPCTSTR lpszAddrFrom
, // ·¢ËÍÕß E-Mail µØÖ·
135 LPCTSTR lpszAddrTo
, // ½ÓÊÕÕßµÄ E-Mail µØÖ·
136 LPCTSTR lpszFromName
, // ·¢ËÍÕßµÄÃû×Ö£¬ÀýÈ磺лºìΰ
137 LPCTSTR lpszReceiverName
, // ½ÓÊÕÕßµÄÃû×Ö£¬ÀýÈ磺ÕÅ·É
138 LPCTSTR lpszSubject
, // ÓʼþÖ÷Ìâ
139 LPCTSTR lpszBody
, // ÓʼþÄÚÈÝ
140 LPCTSTR lpszCharSet
=NULL
, // ×Ö·û¼¯ÀàÐÍ£¬ÀýÈ磺·±ÌåÖÐÎÄÕâÀïÓ¦ÊäÈë"big5"£¬¼òÌåÖÐÎÄʱÊäÈë"gb2312"
141 CStringArray
*pStrAryAttach
=NULL
, // ¸½¼þÎļþ·¾¶£¬¿ÉÒÔ¶à¸ö
142 LPCTSTR pStrAryCC
=NULL
, // ³ËÍ E-Mail µØÖ·£¬¿ÉÒÔ¶à¸ö
143 UINT nSmtpSrvPort
=25, // SMTP ·þÎñÆ÷µÄ TCP ¶Ë¿ÚºÅ
144 LPCTSTR pSend
= NULL
,
145 LPCTSTR ToList
= NULL
151 #endif // !defined(AFX_HwSMTP_H__633A52B7_1CBE_41D7_BDA3_188D98D692AF__INCLUDED_)