Fix email mimetype for attachment
This commit is contained in:
parent
5ea7edac57
commit
ea8c61f2ce
2 changed files with 9 additions and 4 deletions
|
|
@ -19,10 +19,14 @@
|
|||
*/
|
||||
// Copyright Author Dany De Bontridder danydb@aevalys.eu
|
||||
|
||||
/*! \file
|
||||
/*!
|
||||
* \file
|
||||
* \brief Class Document corresponds to the table document
|
||||
*/
|
||||
/*! \brief Class Document corresponds to the table document
|
||||
/*!
|
||||
* \class
|
||||
* \brief
|
||||
* Class Document corresponds to the table DOCUMENT
|
||||
*/
|
||||
|
||||
class Document
|
||||
|
|
@ -38,7 +42,7 @@ class Document
|
|||
var $d_number; /*!< $d_number number of the document */
|
||||
var $md_id; /*!< $md_id document's template */
|
||||
var $f_id; /*!< fiche.f_id */
|
||||
private $counter; /*!< counter for the items ( goods ) */
|
||||
protected $counter; /*!< counter for the items ( goods ) */
|
||||
var $d_name; /*!< document name */
|
||||
var $md_type ; /*!< Type of document */
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ class Sendmail_Core
|
|||
|
||||
$file = $this->afile[$i];
|
||||
$file_size = filesize($file->full_name);
|
||||
$mimetype= mime_content_type($file->full_name);
|
||||
$handle = fopen($file->full_name, "r");
|
||||
if ( $handle == false ){
|
||||
\record_log("SC159 ".var_export($file,true));
|
||||
|
|
@ -165,7 +166,7 @@ class Sendmail_Core
|
|||
fclose($handle);
|
||||
$content = chunk_split(base64_encode($content));
|
||||
$this->content .= "--" . $separator . $eol;
|
||||
$this->content .= "Content-Type: " . $file->type . "; name=\"" . $file->filename . "\"" . $eol;
|
||||
$this->content .= "Content-Type: " . $mimetype . "; name=\"" . $file->filename . "\"" . $eol;
|
||||
$this->content .= "Content-Disposition: attachment; filename=\"" . $file->filename . "\"" . $eol;
|
||||
$this->content .= "Content-Transfer-Encoding: base64" . $eol;
|
||||
$this->content.=$eol;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue