Yii Framework Forum: Problem with custom e-mail headers in CEmailLogRoute - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Problem with custom e-mail headers in CEmailLogRoute Rate Topic: -----

#1 User is offline   limion 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 06-August 11
  • Location:Odessa, Ukraine

Posted 20 August 2012 - 05:39 AM

Hi to all!

I see a strange behavior of CEmailLogRoute.
Here is my config:
array(
                    'class'=>'CEmailLogRoute',
                    'levels'=>'error, warning, info',
                    'emails'=>'support@example.com',
                    'headers'=>array(
                        'Content-Type'=>"text/plain; charset=UTF-8",
                        'TestHeader'=>"TestValue"
                    )
                ),

And E-mail I receive has not such headers, but values are added to the letter's body like this:

text/plain; charset=UTF-8

TestValue

2012/08/20 10:12:12 [error] [exception.CHttpException.404] exception...

Any help will be appreciated )

Yii 1.1.10
0

#2 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 532
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 20 August 2012 - 06:27 AM

Which Mail Transport Agent are you using on that system?
As stated in php mail() api doc there are some MTAs that convert \n to \r\n even if there is already \r\n in the mail header and so they break the header.
0

#3 User is offline   limion 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 06-August 11
  • Location:Odessa, Ukraine

Posted 25 August 2012 - 07:47 AM

View PostCeBe, on 20 August 2012 - 06:27 AM, said:

Which Mail Transport Agent are you using on that system?
As stated in php mail() api doc there are some MTAs that convert \n to \r\n even if there is already \r\n in the mail header and so they break the header.


Hallo,CeBe

I'm using Exim but I have solved my problem ) Headers array should looks like:

array(
    'Content-Type: text/plain; charset=UTF-8',
    'TestHeader: TestValue'
) 


I think that in documentation is not stated clearly about this issue.
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users