Zend Framework 2, Zend_Mail: how to send email using both html and text parts?

$html = new MimePart($email->getBodyHtml()); $html->type = 'text/html'; ... $text = new MimePart($email->getBodyText()); $text->type = 'text/plain'; ... $mimeParts = array($html, $text); ... $body->setParts($mimeParts); 

This works fine, but the email I receive contains both html and text parts - and I mean that both of them are shown.

Gmail first displays the HTML, and then a portion of the plain text is displayed right there. Obviously, I would like to show only the HTML part, and the text part is used only when HTML is not available in the mail client.

Cheers, Andrew

+4
source share
2 answers

Rob Allen DevNotes

Simple ... when you know how!

+3
source

The documentation only mentions http://framework.zend.com/manual/2.0/en/modules/zend.mail.introduction.html . No setParts .

0
source

Source: https://habr.com/ru/post/1442196/


All Articles