You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by "Nicolas (JIRA)" <ji...@apache.org> on 2011/07/15 17:02:00 UTC

[jira] [Created] (LOG4PHP-144) LoggerAppenderMail not using the layout's Content-Type

LoggerAppenderMail not using the layout's Content-Type
------------------------------------------------------

                 Key: LOG4PHP-144
                 URL: https://issues.apache.org/jira/browse/LOG4PHP-144
             Project: Log4php
          Issue Type: Bug
          Components: Code
         Environment: Unrelated
            Reporter: Nicolas
            Priority: Minor


When you pair a LoggerAppenderMail and a LoggerLayoutHtml, the e-mail is sent with the text/plain Content-Type header, causing the HTML to be displayed as plain text. The LoggerAppenderMail seems to ignore the layout's content type. A simple addition to the mail() function's headers fixes this issue as far as I'm concerned:
"From: {$from}\r\nContent-Type: {$this->layout->getContentType()}\r\n"

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (LOG4PHP-144) LoggerAppenderMail not using the layout's Content-Type

Posted by "Nicolas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas updated LOG4PHP-144:
----------------------------

    Attachment: content-type.patch

Small patch illustrating the change

> LoggerAppenderMail not using the layout's Content-Type
> ------------------------------------------------------
>
>                 Key: LOG4PHP-144
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-144
>             Project: Log4php
>          Issue Type: Bug
>          Components: Code
>         Environment: Unrelated
>            Reporter: Nicolas
>            Priority: Minor
>         Attachments: content-type.patch
>
>
> When you pair a LoggerAppenderMail and a LoggerLayoutHtml, the e-mail is sent with the text/plain Content-Type header, causing the HTML to be displayed as plain text. The LoggerAppenderMail seems to ignore the layout's content type. A simple addition to the mail() function's headers fixes this issue as far as I'm concerned:
> "From: {$from}\r\nContent-Type: {$this->layout->getContentType()}\r\n"

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira