From 1418f2e3f8dec41e8ec6504786f40c87a87f84bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Jul 2011 11:07:12 +0000 Subject: [PATCH] Try to fix crl-lf into emails --- htdocs/lib/CMailFile.class.php | 36 ++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/htdocs/lib/CMailFile.class.php b/htdocs/lib/CMailFile.class.php index bc068114740..1184ad3fd07 100644 --- a/htdocs/lib/CMailFile.class.php +++ b/htdocs/lib/CMailFile.class.php @@ -25,7 +25,7 @@ /** * \file htdocs/lib/CMailFile.class.php * \brief File of class to send emails (with attachments or not) - * \version $Id: CMailFile.class.php,v 1.145 2011/07/09 06:10:04 hregis Exp $ + * \version $Id: CMailFile.class.php,v 1.146 2011/07/20 11:07:12 eldy Exp $ * \author Dan Potter. * \author Eric Seigne * \author Laurent Destailleur. @@ -57,11 +57,6 @@ class CMailFile var $smtps; // Contains SMTPs object (if this method is used) - // simplemail - //var $simplemail; // Contains simplemail object (if this method is used) - //var $sName; - //var $sEmail; - //CSS var $css; //! Defined css style for body background @@ -87,6 +82,7 @@ class CMailFile /** * CMailFile + * * @param subject Topic/Subject of mail * @param to Recipients emails (RFC 2822: "Nom prenom [, ...]" ou "email[, ...]" ou "[, ...]") * @param from Sender email (RFC 2822: "Nom prenom [, ...]" ou "email[, ...]" ou "[, ...]") @@ -107,10 +103,10 @@ class CMailFile { global $conf; - // On definit fin de ligne - $this->eol="\n"; - if (preg_match('/^win/i',PHP_OS)) $this->eol="\r\n"; - if (preg_match('/^mac/i',PHP_OS)) $this->eol="\r"; + // We define end of line (RFC 822bis section 2.3) + $this->eol="\r\n"; + //if (preg_match('/^win/i',PHP_OS)) $this->eol="\r\n"; + //if (preg_match('/^mac/i',PHP_OS)) $this->eol="\r"; // On defini mixed_boundary $this->mixed_boundary = md5(uniqid("dolibarr1")); @@ -465,7 +461,7 @@ class CMailFile } /** - * Read a file on disk and return encoded content for emails + * Read a file on disk and return encoded content for emails (mode = 'mail') * * @param sourcefile * @return <0 if KO, encoded string if OK @@ -611,7 +607,7 @@ class CMailFile /** - * Creation header MIME (mode = 'mail') + * Create header MIME (mode = 'mail') * * @param filename_list * @param mimefilename_list @@ -640,7 +636,7 @@ class CMailFile } /** - * Permet d'ecrire le corps du message (mode = 'mail') + * Return email content (mode = 'mail') * * @param msgtext */ @@ -704,7 +700,7 @@ class CMailFile } /** - * Permet d'attacher un fichier (mode = 'mail') + * Attach file to email (mode = 'mail') * * @param filename_list Tableau * @param mimetype_list Tableau @@ -749,7 +745,7 @@ class CMailFile /** - * Permet d'attacher une image (mode = 'mail') + * Attach an image to email (mode = 'mail') * * @param images_list Tableau * @return out Chaine images encodees @@ -781,6 +777,7 @@ class CMailFile /** * Try to create a socket connection + * * @param $host Add ssl:// for SSL/TLS. * @param $port Example: 25, 465 * @return Socket id if ok, 0 if KO @@ -817,9 +814,9 @@ class CMailFile } /** - * This function has been modified as provided - * by SirSir to allow multiline responses when + * This function has been modified as provided by SirSir to allow multiline responses when * using SMTP Extensions. + * * @param socket * @param response * @return boolean @@ -848,9 +845,9 @@ class CMailFile } /** - * Recherche la presence d'images dans le message html + * Seearch images into html message and init array this->images_encoded if found * - * @param images_dir Emplacement des images + * @param images_dir Location of physical images files * @return int >0 if OK, <0 if KO */ function findHtmlImages($images_dir) @@ -938,6 +935,7 @@ class CMailFile /** * Return an address for SMTP protocol + * * @param adresses Example: 'John Doe ' or 'john@doe.com' * @param format 0=Auto, 1=emails with <>, 2=emails without <> * @param encode 1=Encode name to RFC2822