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 text base64.
  • so, encoded text subject plain text.

you should use email subject string/plain text. mail services doesn't decode custom encode type automatically.

change subject string :

$newsubject='=?utf-8?b?'.base64_encode($subject).'?='; #to $newsubject=$subject; 

search typing emailtransport or email config/app.php , check email configuration correctly configured.

her details cakephp 3.x email


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -