Forums / Extensions / eZ Newsletter / Bug in eZ Newsletter, HTML vs. plain text email

Bug in eZ Newsletter, HTML vs. plain text email

Author Message

Harry Oosterveen

Thursday 10 April 2008 8:22:01 am

The newsletter emails are generated in the class eZNewsletter; the contenttype is set to 'sms' or 'multipart/related' (for HTML newsletters), but never to 'text/plain'. Apparently, it assumes that the contenttype for the eZNewsletterMail class is always 'text/plain'.

However, when the eZNewsletterMail is created, the contenttype is initially set to 'text/plain', but subsequently changed into the prefered contenttype from the site.ini - MailSettings - ContentType settings. So if this is set to text/html, eZNewsletterMail will default to text/html, and plain text mails will be sent with the 'ContentType: text/html' header and will be displayed without line breaks.

To fix the bug, edit classes/eznewslettermail.php, and comment out lines 81/82 (this refers to version 1.5.3)

//    if ( $ini->hasVariable( 'MailSettings', 'ContentType' ) )
//        $this->setContentType( $ini->variable( 'MailSettings', 'ContentType' ) );

Pål Jostein Didriksen

Thursday 09 April 2009 11:46:56 am

I have the same problem, but using eZ 4.0.1 and eznewsletter 1.6. The eznewsletter.php looks different, missing the section you commented out.

I also get plain text-mails wihtout linebreaks, and my html-mails don't display at all. When I look at the message source, it looks something like this:

This message is in MIME format. Since your mail reader does not understandthis format, some or all of this message may not be legible.--200904091919911:12941:0Content-Type: text/html; charset=utf-8Content-Transfer-Encoding: 8bit<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>    <head>        <meta http-equiv="content-type" content="text/html; charset=windows-1250">								    </head>    <body style="margin:0;padding:0; font-family: Verdana;">	  </body></html>--200904091919911:12941:0--

--Boundary_(ID_0XT4Sdgy4yDfhOv69kVe4w)--

(Newsletter content was deleted to shorten the code)

Any experience on this issue?