From 91d3b525e85349c73acdbfa3312d07e5ebbf6c4c Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Sat, 22 Jul 2006 15:09:22 +0000
Subject: [PATCH] Modification pour envoyer un mailing au format html

---
 htdocs/lib/CMailFile.class.php | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/htdocs/lib/CMailFile.class.php b/htdocs/lib/CMailFile.class.php
index 664ed736a59..1f6ddbcd8c0 100644
--- a/htdocs/lib/CMailFile.class.php
+++ b/htdocs/lib/CMailFile.class.php
@@ -228,18 +228,20 @@ class CMailFile
         if (count($filename_list))
         {
             $out = "--" . $this->mime_boundary . "\n";
-            if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING)
-            {
-            	$out .= "Content-Type: text/html; charset=\"iso8859-15\"\n\n";
-            	$out .= "Content-Transfer-Encoding: quoted-printable\n\n";
-            }
-            else
-            {
-            	$out = $out . "Content-Type: text/plain; charset=\"iso8859-15\"\n\n";
-            }
+            $out .= "Content-Type: text/plain; charset=\"iso8859-15\"\n\n";
             //	  $out = $out . "Content-Type: text/plain; charset=\"us-ascii\"\n\n";
         }
-        $out = $out . $msgtext . "\n";
+        if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING)
+        {
+        	$out .= "<html><BODY>\n";
+        	$out .= "<html><head><title></title></head><body>";
+          $out .= $msgtext;
+          $out .= "</body></html>";
+        }
+        else
+        {
+        	$out .= $msgtext . "\n";
+        }
         return $out;
     }
 
@@ -283,6 +285,12 @@ class CMailFile
         
         //    if($this->errors_to != "")
         //$out = $out . "Errors-to: ".$this->errors_to."\n";
+        
+        if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING)
+        {
+        	$out .= "Content-Type: text/html; charset=\"iso-8859-15\"\n";
+        	$out .= "Content-Transfer-Encoding: 8bit\n";
+        }
 
         dolibarr_syslog("CMailFile::write_smtpheaders $out");
         return $out;
-- 
GitLab