OSDN Git Service

Fix Issue #102: Invalid patch e-mails generated by TortoiseGit
authorFrank Li <lznuaa@gmail.com>
Wed, 24 Jun 2009 00:59:56 +0000 (08:59 +0800)
committerFrank Li <lznuaa@gmail.com>
Wed, 24 Jun 2009 00:59:56 +0000 (08:59 +0800)
Commit by filip.navara@gmail.com

Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Utils/HwSMTP.cpp

index 3228eb8..9068588 100644 (file)
@@ -93,8 +93,8 @@ CHwSMTP::CHwSMTP () :
        m_nSmtpSrvPort ( 25 ),\r
        m_bMustAuth ( TRUE )\r
 {\r
-       m_csMIMEContentType = _T( "multipart/mixed");\r
        m_csPartBoundary = _T( "WC_MAIL_PaRt_BoUnDaRy_05151998" );\r
+       m_csMIMEContentType = FormatString ( _T( "multipart/mixed; boundary=%s" ), m_csPartBoundary);\r
        m_csNoMIMEText = _T( "This is a multi-part message in MIME format." );\r
        //m_csCharSet = _T("\r\n\tcharset=\"iso-8859-1\"\r\n");\r
 \r
@@ -289,7 +289,7 @@ BOOL CHwSMTP::SendEmail (
                m_StrAryAttach.Append ( *pStrAryAttach );\r
        }\r
        if ( m_StrAryAttach.GetSize() < 1 )\r
-               m_csMIMEContentType = _T( "text/plain");\r
+               m_csMIMEContentType = FormatString ( _T( "text/plain; %s" ), m_csCharSet);\r
 \r
        // ´´½¨Socket\r
        m_SendSock.Close();\r
@@ -526,7 +526,7 @@ BOOL CHwSMTP::SendSubject()
        COleDateTime tNow = COleDateTime::GetCurrentTime();\r
        if ( tNow > 1 )\r
        {\r
-               csSubject += GetCompatibleString(FormatDateTime (tNow, _T("%a, %d %b %y %H:%M:%S %Z")).GetBuffer(0),FALSE);\r
+               csSubject += FormatDateTime (tNow, _T("%a, %d %b %y %H:%M:%S %Z"));\r
        }\r
        csSubject += _T("\r\n");\r
        csSubject += FormatString ( _T("From: %s\r\n"), this->m_csAddrFrom);\r
@@ -546,8 +546,10 @@ BOOL CHwSMTP::SendSubject()
        CString m_csToList;\r
 \r
        csSubject += FormatString ( _T("Subject: %s\r\n"), m_csSubject );\r
-       csSubject += FormatString ( _T("X-Mailer: TortoiseGit\r\nMIME-Version: 1.0\r\nContent-Type: %s; %s boundary=%s\r\n\r\n") , \r
-               m_csMIMEContentType, m_csCharSet, m_csPartBoundary );\r
+\r
+    \r
+       csSubject += FormatString ( _T("X-Mailer: TortoiseGit\r\nMIME-Version: 1.0\r\nContent-Type: %s\r\n\r\n"),\r
+               m_csMIMEContentType );\r
 \r
        return Send ( csSubject );\r
 }\r