Ajout de nombreux syslog pour debuggage

This commit is contained in:
Rodolphe Quiedeville 2004-10-19 13:16:16 +00:00
parent 9115ee703f
commit 6bea3e40b1

View File

@ -1,4 +1,28 @@
<?php <?php
/* Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/
*
* $Id$
* $Source$
*
*/
/* notes from Dan Potter: /* notes from Dan Potter:
Sure. I changed a few other things in here too though. One is that I let Sure. I changed a few other things in here too though. One is that I let
you specify what the destination filename is (i.e., what is shows up as in you specify what the destination filename is (i.e., what is shows up as in
@ -19,7 +43,7 @@ to chunk_split
/* Note: if you don't have base64_encode on your sytem it will not work */ /* Note: if you don't have base64_encode on your sytem it will not work */
/*! \file htdocs/lib/CMailFile.class.php /*! \file htdocs/lib/CMailFile.class.php
\brief Classe permettant d'envoyer des attachements par mail \brief Classe permettant d'envoyer des mail avec attachements, recriture de CMailFile
\author Dan Potter. \author Dan Potter.
\author Eric Seigne \author Eric Seigne
\author Rodolphe Quiedeville \author Rodolphe Quiedeville
@ -51,7 +75,7 @@ class DolibarrMail
var $smtp_headers; var $smtp_headers;
/*! /*!
\brief CMailFile \brief DolibarrMail
\param subject \param subject
\param to \param to
\param from \param from
@ -75,6 +99,10 @@ class DolibarrMail
$this->addr_bcc = ""; $this->addr_bcc = "";
$this->addr_cc = ""; $this->addr_cc = "";
$this->reply_to = ""; $this->reply_to = "";
dolibarr_syslog("DolibarrMail::DolibarrMail");
dolibarr_syslog("DolibarrMail::DolibarrMail to : ".$this->addr_to);
dolibarr_syslog("DolibarrMail::DolibarrMail from : ".$this->from);
} }
/*! /*!
@ -86,6 +114,8 @@ class DolibarrMail
function PrepareFile($filename_list, $mimetype_list, $mimefilename_list) function PrepareFile($filename_list, $mimetype_list, $mimefilename_list)
{ {
dolibarr_syslog("DolibarrMail::PrepareFile");
$this->mime_headers=""; $this->mime_headers="";
$this->smtp_headers = $this->write_smtpheaders(); $this->smtp_headers = $this->write_smtpheaders();
@ -152,6 +182,10 @@ class DolibarrMail
$encoded = $this->my_chunk_split(base64_encode($contents)); $encoded = $this->my_chunk_split(base64_encode($contents));
fclose($fd); fclose($fd);
} }
else
{
dolibarr_syslog("DolibarrMail::encode_file");
}
return $encoded; return $encoded;
} }
@ -161,6 +195,8 @@ class DolibarrMail
function sendfile() function sendfile()
{ {
dolibarr_syslog("DolibarrMail::sendfile");
$headers .= $this->smtp_headers . $this->mime_headers; $headers .= $this->smtp_headers . $this->mime_headers;
$message = $this->text_body . $this->text_encoded; $message = $this->text_body . $this->text_encoded;
@ -181,6 +217,10 @@ class DolibarrMail
$out = $out . "Content-Type: text/plain; charset=\"iso8859-15\"\n\n"; $out = $out . "Content-Type: text/plain; charset=\"iso8859-15\"\n\n";
// $out = $out . "Content-Type: text/plain; charset=\"us-ascii\"\n\n"; // $out = $out . "Content-Type: text/plain; charset=\"us-ascii\"\n\n";
} }
else
{
dolibarr_syslog("DolibarrMail::write_body");
}
$out = $out . $this->message . "\n"; $out = $out . $this->message . "\n";
return $out; return $out;
} }