From 7a0131d611175ce6f18b51db0f51f82e70e3585d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 15 Sep 2009 13:19:19 +0000 Subject: [PATCH] 2009-09-15 15:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbtip/sendmail.prg ! Applied patch from Alex Strickland. Fixes wrong encoding (7-bit). Fixed mails sent as multi-part even if there was only simple body. * utils/hbmk2/hbmk2.prg ! Fixed stupid error in last cmomit. --- harbour/ChangeLog | 9 ++++++++ harbour/contrib/hbtip/sendmail.prg | 35 ++++++++++++++++++++---------- harbour/utils/hbmk2/hbmk2.prg | 5 ++++- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5f1c823d99..be9a185103 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,15 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-15 15:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbtip/sendmail.prg + ! Applied patch from Alex Strickland. + Fixes wrong encoding (7-bit). + Fixed mails sent as multi-part even if there was only simple body. + + * utils/hbmk2/hbmk2.prg + ! Fixed stupid error in last cmomit. + 2009-09-15 12:09 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbwin/win_com.c ! fixed small typo in UNICODE builds diff --git a/harbour/contrib/hbtip/sendmail.prg b/harbour/contrib/hbtip/sendmail.prg index 2c36e2f08b..5da642e689 100644 --- a/harbour/contrib/hbtip/sendmail.prg +++ b/harbour/contrib/hbtip/sendmail.prg @@ -226,21 +226,34 @@ FUNCTION hb_SendMail( cServer, nPort, cFrom, aTo, aCC, aBCC, cBody, cSubject, aF oUrl:nPort := nPort oUrl:cUserid := StrTran( cUser, "&at;", "@" ) - oMail := tipMail():new() - oAttach := tipMail():new() - oAttach:SetEncoder( "7-bit" ) + oMail := tipMail():new() + oMail:SetEncoder( "7bit" ) + IF ! Empty( aFiles ) + oAttach := tipMail():new() + oAttach:SetEncoder( "7bit" ) - IF ( ".htm" $ Lower( cBody ) .OR. ".html" $ Lower( cBody ) ) .AND. hb_FileExists( cBody ) - cMimeText := "text/html ; charset=ISO-8859-1" - oAttach:hHeaders[ "Content-Type" ] := cMimeText - cBodyTemp := cBody - cBody := MemoRead( cBodyTemp ) + Chr( 13 ) + Chr( 10 ) + IF ( ".htm" $ Lower( cBody ) .OR. ".html" $ Lower( cBody ) ) .AND. hb_FileExists( cBody ) + cMimeText := "text/html; charset=ISO-8859-1" + oAttach:hHeaders[ "Content-Type" ] := cMimeText + cBodyTemp := cBody + cBody := MemoRead( cBodyTemp ) + Chr( 13 ) + Chr( 10 ) + ELSE + oAttach:hHeaders[ "Content-Type" ] := "text/plain; charset=iso8851" + ENDIF + oAttach:SetBody( cBody ) + oMail:Attach( oAttach ) ELSE - oMail:hHeaders[ "Content-Type" ] := "text/plain; charset=iso8851" + IF ( ".htm" $ Lower( cBody ) .OR. ".html" $ Lower( cBody ) ) .AND. hb_FileExists( cBody ) + cMimeText := "text/html ; charset=ISO-8859-1" + oMail:hHeaders[ "Content-Type" ] := cMimeText + cBodyTemp := cBody + cBody := MemoRead( cBodyTemp ) + Chr( 13 ) + Chr( 10 ) + ELSE + oMail:hHeaders[ "Content-Type" ] := "text/plain; charset=iso8851" + ENDIF + oMail:SetBody( cBody ) ENDIF - oAttach:SetBody( cBody ) - oMail:Attach( oAttach ) oUrl:cFile := cTo + iif( Empty( cCC ), "", "," + cCC ) + iif( Empty( cBCC ), "", "," + cBCC ) oMail:hHeaders[ "Date" ] := tip_Timestamp() diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 5bbfd41e10..dfc04a6559 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -602,7 +602,10 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) LOCAL cBin_Dyn LOCAL cPath_CompC LOCAL nErrorLevel := 0 - LOCAL tmp, tmp1, tmp2, tmp3, array + LOCAL tmp, tmp1, tmp2, array +#if defined( __PLATFORM__UNIX ) + LOCAL tmp3 +#endif LOCAL cScriptFile LOCAL fhnd LOCAL cFile