// print_r($parts);exit;
if($this->attachments){
//if got a attachments
+ $contentType = 'Content-Type: text/plain; charset=utf-8';
if (isset($parts[1]['Content-Type'])) {
+ $contentType = $parts[1]['Content-Type'];
unset($parts[1]['Content-Type']);
}
$random_hash = md5(date('r', time()));
Content-Type: multipart/alternative; boundary=alt-$random_hash
--alt-$random_hash
+Content-Type: $contentType
+
{$parts[2]}
--alt-$random_hash--
foreach($this->attachments as $attch){
$str .= "
--mixed-$random_hash
-Content-Type: {$attch['mimetype']}; ".(empty($attch['name'])) ? '' : "name=\"{$attch['name']}\"
-Content-Transfer-Encoding: base64
+Content-Type: {$attch['mimetype']}; ".
+((empty($attch['name'])) ? '' : "name=\"{$attch['name']}\"") .
+"Content-Transfer-Encoding: base64
Content-Disposition: attachment
{$attch['file']}