Skip to content

Instantly share code, notes, and snippets.

@slywalker
Created March 16, 2012 09:00
Show Gist options
  • 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