tuxonice Posted September 23, 2009 at 04:22 PM Report Share #288330 Posted September 23, 2009 at 04:22 PM Oi pessoal, ando a desenvolver código para enviar email com o phpmailer em que a mensagem tem de ter a codificação UTF-8 (para texto em russo). $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = $smtp_server; // SMTP server $mail->CharSet = 'UTF8'; $mail->IsHTML(true); $mail->From = $admin_email; $mail->FromName = $admin_name; $mail->AddAddress($email); $mail->Subject = '$subject; $mail->Body = $body; $mail->Send(); o problema é que o assunto ($mail->Subject) não aceita caracteres em UTF-8, ao contrario do que acontece no body em que aparece tudo bem. Alguém tem alguma sugestão? Link to comment Share on other sites More sharing options...
_JR_ Posted September 30, 2009 at 11:08 AM Report Share #289301 Posted September 30, 2009 at 11:08 AM http://bytes.com/topic/php/answers/574886-unicode-entities-email-subject define("ENCODING", "UTF-8"); $subj = "Fui às compras"; $header = "Subject: =?" . ENCODING . "?B?" . base64_encode($subj) . "?=\r\n"; Experimenta adicionar isso aos headers (e retirar o subject do $mail, ja agora). Não testei, já agora. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now