Skip to content

Instantly share code, notes, and snippets.

@suzuki
Created May 21, 2012 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suzuki/2760759 to your computer and use it in GitHub Desktop.
Save suzuki/2760759 to your computer and use it in GitHub Desktop.
An idea of CakeEmail content-type detection
protected function _getContentTypeCharset() {
switch($this->charset) {
case 'iso-2022-jp-ms':
$charset = 'iso-2022-jp';
break;
default:
$charset = $this->charset;
}
return $charset;
}
https://github.com/cakephp/cakephp/blob/2.1/lib/Cake/Network/Email/CakeEmail.php#L1356
$msg[] = 'Content-Type: text/plain; charset=' . $this->_getContentTypeCharset();
https://github.com/cakephp/cakephp/blob/2.1/lib/Cake/Network/Email/CakeEmail.php#L1369
$msg[] = 'Content-Type: text/html; charset=' . $this->_getContentTypeCharset()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment