php - Cakephp email Encoding subject gives wrong characters -
i'm sending emails cakephp , have been testing followign website: http://spamcheck.postmarkapp.com/
i have had several problems, 1 of them encoding of subject.
right now, 1 solved, following solutions i've found in internet. first line of code i'm doing subject
here's code:
$newsubject='=?utf-8?b?'.base64_encode($subject).'?='; $email = new email('aws'); $email->from(['xxxx@zzzz.zz' => 'test']) ->template('default','confirmation') ->viewvars([ 'user_email' => $emailto, ]) ->emailformat('both') ->to($emailto) ->subject($newsubject) ->replyto('support@uphill.pt') ->helpers(['html', 'text']) //->attachments($attachment->path) ->send($message);
after recieve email, subject shows: "=?utf-8?b?sw5zy3jpw6fdo28gbm8gzxzlbnrvoiboyxrpb25hbcbdb25mzxjlbmnlig9uieh1bwfuifbhcglsbg9tysbwaxj1cw==?="
what missing?
edit:
i'm using cakephp 3.3 , here's aws email transporter config
'aws' => [ 'transport' => 'aws', 'from' => 'xxxx@zzzzz.z', 'charset' => 'utf-8', 'headercharset' => 'utf-8', ]
here's email:
http://pastie.org/private/hzcicqrlzx425ucanxyl5a
thanks
about result :
- you encoded email
subject
textbase64
. - so,
encoded
textsubject
plain text.
you should use email
subject
string/plain text. mail services doesn'tdecode
customencode
type automatically.
change subject
string :
$newsubject='=?utf-8?b?'.base64_encode($subject).'?='; #to $newsubject=$subject;
search typing
emailtransport
orconfig/app.php
, check email configuration correctly configured.
her details cakephp 3.x email
Comments
Post a Comment