PHP Classes

Send Plaintext+html+files

Recommend this page to a friend!

      All In One - dSendMail2  >  All threads  >  Send Plaintext+html+files  >  (Un) Subscribe thread alerts  
Subject:Send Plaintext+html+files
Summary:correction
Messages:1
Author:Roman
Date:2011-06-09 23:59:49
 

  1. Send Plaintext+html+files   Reply   Report abuse  
Picture of Roman Roman - 2011-06-09 23:59:50
There's a bug in your code.

When you try to send both HTML/plain text and files it will just send Plaintext+files.

function buildMessage()

The switch block is wrong.

if we put the code below to be the first case - it will do the job

case $html AND $attachments AND !$html_images:
$message = &$this->_addMixedPart();
if (!is_null($this->html_text)) {
$alt = &$this->_addAlternativePart($message);
$this->_addTextPart($alt, $this->html_text);
$this->_addHtmlPart($alt);
} else {
$this->_addHtmlPart($message);
}
for ($i=0; $i<count($this->attachments); $i++) {
$this->_addAttachmentPart($message, $this->attachments[$i]);
}


Thanks,
Roman Granovskyi
Aussiedev Consulting
www.aussiedev.com.au