[Solved] Yii Mail Unwanted Ascii Code

Hi all,

I use the Yii-mail extension the following way :

$message = new YiiMailMessage;

$message->view = 'mail';

$message->setBody(array('model'=>$model), 'text/html');

$message->subject = Yii::t('tr','my subject');


$message->from = 'you@you.com';


and in view file

<h1><?php echo(Yii::t('tr','This is HTML mail')); ?></h1>

<?php echo CHtml::link('Mylink', array('controller/view', 'id'=>$model->id)); ?>

but in the resulting email I always get some strange unwanted ASCII code

MIME-Version: 1.0

Content-Type: text/html; charset=utf-8

Content-Transfer-Encoding: quoted-printable

<h1>This is HTML mail</h1>

<a href=3D"/testdrive/index.php?r=3Dcontroller/v=iew&id=3D234137">Mylink</a>

I see in the comments there maybe problem in the title with character encoding but nothing about

message body.

Anyhelp would be higly welcome as I have no idea where I could start to search to solve this !

and goole was not my friend in searching.

(PS This question has duplicate in StackOverflow)

It seems that what you’re seeing is how the equals (=) char is represented under the quoted-printable encoding.

How is this actually displayed in your email application or webmail?

This. It’s perfectly fine. By the way: You want to create that link with Yii::app()->createAbsoluteUrl() ;)

Hoho !!! - Seems this is why my link is not working Not due to these extra characters…

Thanks both of you for comments and for pointing out this one will try it monday at office.

This has been confirmed - Only the link was not good.

I had never noticed before the way it works for quoted-printable encoding !!!

tks again guys.