It returns HTML like this because it encodes it using quotation mark encoding, which is how the content is actually sent in the mail.
If you want to receive content without encoding, you can try the following:
$part = $mail->getBodyHtml(); // returns Zend_Mime_Part if ($part !== false && $part instanceof Zend_Mime_Part) { $html = $part->getRawContent(); // returns the raw, unencoded content }
When you set the body HTML using Zend_Mail :: setBodyHtml (), you can specify the encoding. Function prototype setBodyHtml($html, $charset = null, $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE)
Valid parameters:
- Zend_Mime :: ENCODING_7BIT
- Zend_Mime :: ENCODING_8BIT
- Zend_Mime :: ENCODING_QUOTEDPRINTABLE (default)
- Zend_Mime :: ENCODING_BASE64
You can either check the HTML before calling setBodyHtml, if possible, or get the raw, unencoded content using the method shown above. Otherwise, getBodyHtml () will return the HTML in its encoded format.
source share