- #pragma once
- /********************************************************************
- created: 2009:2:9 10:18
- author: 李欣
- filename: e:MyProjectSimpleMailSimpleMailPop3Message.h
- classname: CPop3Message
- purpose: Parse the mail header to extract the info needed
- *********************************************************************/
- class CPop3Message
- {
- public:
- CPop3Message(void);
- ~CPop3Message(void);
- ///<summary>
- /// pass the mail header to this object
- ///</summary>
- ///<param name = pszMail>
- /// the content of the mail header
- ///</param>
- void SetTopMailContent(IN LPCTSTR pszMail);
- ///<summary>
- /// pass all the mail to this object
- ///</summary>
- ///<param name = pszMail>
- /// the content of the mail
- ///</param>
- void SetMailContent(IN LPCTSTR pszMail);
- ///<summary>
- /// override the operator
- ///</summary>
- BOOL operator==(IN const CPop3Message& cMsg);
- ///<summary>
- /// acquire the sender of the mail
- ///</summary>
- CString GetMailFrom()const;
- ///<summary>
- /// acquire the subject of the mail
- ///</summary>
- CString GetMailSubject()const;
- ///<summary>
- /// acquire the Date of the mail
- ///</summary>
- CString GetMailDate()const;
- ///<summary>
- /// acquire the mail content
- ///</summary>
- CString GetMailContent()const;
- private:
- ///<summary>
- /// parse the mail header
- ///</summary>
- void DecodeHeader();
- ///<summary>
- /// parse the mail to extract the mail content
- ///</summary>
- void ExtractMailContent();
- ///<summary>
- /// parse the time format to give a more proper one to show
- ///</summary>
- void ParseTime();
- ///<summary>
- /// convert the English name referred to week into Chinese
- ///</summary>
- ///<param name = strEng>
- /// the name in English
- ///</param>
- /// <returns>
- /// the name in Chinese
- /// </returns>
- CString ConvertWeekToChinese(IN const CString& strEng);
- ///<summary>
- /// convert the English name referred to month into Chinese
- ///</summary>
- ///</summary>
- ///<param name = strEng>
- /// the name in English
- ///</param>
- /// <returns>
- /// the name in Chinese
- /// </returns>
- CString ConvertMonthToChinese(IN const CString& strEng);
- ///<summary>
- /// parse the "From" part
- ///</summary>
- void ParseFrom();
- ///<summary>
- /// parse the "Subject" part
- ///</summary>
- void ParseSubject();
- ///<summary>
- /// the mail data, maybe the header or the whole mail
- ///</summary>
- CString m_strData;
- ///<summary>
- /// the sender of the mail
- ///</summary>
- CString m_strFrom;
- ///<summary>
- /// the subject of the mail
- ///</summary>
- CString m_strSubject;
- ///<summary>
- /// the Date of the mail
- ///</summary>
- CString m_strDate;
- ///<summary>
- /// the mail content
- ///</summary>
- CString m_strContent;
- };