Created
January 31, 2014 13:43
-
-
Save ricardodantas/8732274 to your computer and use it in GitHub Desktop.
Função para codificar email para UTF8 no envio de emails pela função "mail()" do PHP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function utf8mail($to,$s,$body,$from_name="x",$from_a = "[email protected]", $reply="[email protected]") | |
{ | |
$s= "=?utf-8?b?".base64_encode($s)."?="; | |
$headers = "MIME-Version: 1.0\r\n"; | |
$headers.= "From: =?utf-8?b?".base64_encode($from_name)."?= <".$from_a.">\r\n"; | |
$headers.= "Content-Type: text/plain;charset=utf-8\r\n"; | |
$headers.= "Reply-To: $reply\r\n"; | |
$headers.= "X-Mailer: PHP/" . phpversion(); | |
mail($to, $s, $body, $headers); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment