Skip to content

Instantly share code, notes, and snippets.

@slywalker
Created March 16, 2012 09:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save slywalker/2049221 to your computer and use it in GitHub Desktop.
Save slywalker/2049221 to your computer and use it in GitHub Desktop.
メールの文字化けが怖いあなたに
<?php
App::uses('CakeEmail', 'Network/Email');
class Base64Email extends CakeEmail {
protected function _renderTemplates($content) {
$rendered = parent::_renderTemplates($content);
array_walk($rendered, function(&$val, $key) {
$val = base64_encode($val);
});
return $rendered;
}
protected function _getContentTransferEncoding() {
return 'base64';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment