Add: possibilité d'envoyer un fichier attaché avec du html contenant des images avec
la classe SMTPS
This commit is contained in:
parent
168c177fb5
commit
44ae8f79f2
@ -1985,7 +1985,9 @@ class SMTPs
|
|||||||
if ($type == 'image')
|
if ($type == 'image')
|
||||||
{
|
{
|
||||||
$content = 'Content-Type: multipart/related;' . "\r\n"
|
$content = 'Content-Type: multipart/related;' . "\r\n"
|
||||||
. ' boundary="' . $this->_getBoundary() . '"' . "\r\n";
|
. ' boundary="' . $this->_getBoundary() . '"' . "\r\n"
|
||||||
|
. "\r\n"
|
||||||
|
. 'This is a multi-part message in MIME format.' . "\r\n";
|
||||||
$image=1;
|
$image=1;
|
||||||
}
|
}
|
||||||
else if ($type == 'attachment' && $image)
|
else if ($type == 'attachment' && $image)
|
||||||
@ -1997,6 +1999,7 @@ class SMTPs
|
|||||||
. "\r\n--" . $this->_getBoundary() . "\r\n"
|
. "\r\n--" . $this->_getBoundary() . "\r\n"
|
||||||
. 'Content-Type: multipart/related;' . "\r\n"
|
. 'Content-Type: multipart/related;' . "\r\n"
|
||||||
. ' boundary="' . $this->_getRelatedBoundary() . '"' . "\r\n";
|
. ' boundary="' . $this->_getRelatedBoundary() . '"' . "\r\n";
|
||||||
|
$attachment=1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2004,7 +2007,6 @@ class SMTPs
|
|||||||
. ' boundary="' . $this->_getBoundary() . '"' . "\r\n"
|
. ' boundary="' . $this->_getBoundary() . '"' . "\r\n"
|
||||||
. "\r\n"
|
. "\r\n"
|
||||||
. 'This is a multi-part message in MIME format.' . "\r\n";
|
. 'This is a multi-part message in MIME format.' . "\r\n";
|
||||||
$attachment=1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// END DOL_CHANGE LDR
|
// END DOL_CHANGE LDR
|
||||||
@ -2095,27 +2097,23 @@ class SMTPs
|
|||||||
//$content .= ( $type == 'html') ? 'quoted-printable' : $this->getTransEncodeType(); // DOL_CHANGE LDR
|
//$content .= ( $type == 'html') ? 'quoted-printable' : $this->getTransEncodeType(); // DOL_CHANGE LDR
|
||||||
$content .= ( $type == 'html') ? '8bit' : $this->getTransEncodeType();
|
$content .= ( $type == 'html') ? '8bit' : $this->getTransEncodeType();
|
||||||
$content .= "\r\n"
|
$content .= "\r\n"
|
||||||
//. 'Content-Disposition: inline' . "\r\n"
|
// . 'Content-Disposition: inline' . "\r\n" // DOL_CHANGE LDR
|
||||||
. 'Content-Description: ' . $type . ' message' . "\r\n";
|
. 'Content-Description: ' . $type . ' message' . "\r\n";
|
||||||
|
|
||||||
if ( $this->getMD5flag() )
|
if ( $this->getMD5flag() )
|
||||||
$content .= 'Content-MD5: ' . $_content['md5'] . "\r\n";
|
$content .= 'Content-MD5: ' . $_content['md5'] . "\r\n";
|
||||||
|
|
||||||
|
$content .= "\r\n"
|
||||||
|
. $_content['data'] . "\r\n";
|
||||||
// DOL_CHANGE LDR
|
// DOL_CHANGE LDR
|
||||||
//$content .= "\r\n"
|
|
||||||
// . $_content['data'] . "\r\n"
|
|
||||||
// . "\r\n--" . $this->_getBoundary() . "\r\n";
|
// . "\r\n--" . $this->_getBoundary() . "\r\n";
|
||||||
if ($attachment && $image)
|
if ($attachment && $image)
|
||||||
{
|
{
|
||||||
$content .= "\r\n"
|
$content .= "\r\n--" . $this->_getRelatedBoundary() . "\r\n";
|
||||||
. $_content['data'] . "\r\n"
|
|
||||||
. "\r\n--" . $this->_getRelatedBoundary() . "\r\n";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$content .= "\r\n"
|
$content .= "\r\n--" . $this->_getBoundary() . "\r\n";
|
||||||
. $_content['data'] . "\r\n"
|
|
||||||
. "\r\n--" . $this->_getBoundary() . "\r\n";
|
|
||||||
}
|
}
|
||||||
// END DOL_CHANGE LDR
|
// END DOL_CHANGE LDR
|
||||||
}
|
}
|
||||||
@ -2572,6 +2570,10 @@ class SMTPs
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.6 2009/05/12 11:44:59 hregis
|
||||||
|
* Add: possibilité d'envoyer un fichier attaché avec du html contenant des images avec
|
||||||
|
* la classe SMTPS
|
||||||
|
*
|
||||||
* Revision 1.5 2009/05/12 10:12:02 hregis
|
* Revision 1.5 2009/05/12 10:12:02 hregis
|
||||||
* Add: possibilité d'envoyer un fichier attaché avec du html contenant des images avec
|
* Add: possibilité d'envoyer un fichier attaché avec du html contenant des images avec
|
||||||
* la classe SMTPS
|
* la classe SMTPS
|
||||||
|
|||||||
@ -787,7 +787,7 @@ class CMailFile
|
|||||||
$this->images_encoded[$i]['cid'] = $img["cid"];
|
$this->images_encoded[$i]['cid'] = $img["cid"];
|
||||||
|
|
||||||
// Encodage de l'image
|
// Encodage de l'image
|
||||||
$this->images_encoded[$i]["image_encoded"] = rtrim(chunk_split(base64_encode($image), 68, $this->eol));
|
$this->images_encoded[$i]["image_encoded"] = chunk_split(base64_encode($image), 68, $this->eol);
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user