Skip to content

Instantly share code, notes, and snippets.

@fabiancarlos
Created July 23, 2012 14:34
Show Gist options
  • Save fabiancarlos/3163933 to your computer and use it in GitHub Desktop.
Save fabiancarlos/3163933 to your computer and use it in GitHub Desktop.
force utf-8 mail
function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') {
  $header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";
  mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment