Logical1 Posted May 23, 2009 Share Posted May 23, 2009 Hello I am trying to generate a confirmation email in which the fonts are not in english. I use the code bellow. Problem is that some times the receiver receive the correct fonts & texts and some times giberish. It must depend on the email software used or setting, etc. Can anyone suggest a fool-proof way to ake sure the reciever will get te correct text? Here is the code I am using: $to = $Email1; $subject = "123abc123.com - درخواست "; $from_email= "FROM: 123abc123.com"; $from_name= "[email protected]"; $body = $UN." اسم کارائی:"; $headers = "MIME-Version: 1.0 \n" ; $headers .= "From: " . "".mb_encode_mimeheader (mb_convert_encoding($from_name,"UTF-8","AUTO")) ."" . "<".$from_email."> \n"; $headers .= "Reply-To: " . "".mb_encode_mimeheader (mb_convert_encoding($from_name,"UTF-8","AUTO")) ."" . "<".$from_email."> \n"; $headers .= "Content-Type: text/plain;charset= UTF-8\n"; $body = mb_convert_encoding($body, "UTF-8","AUTO"); $sendmail_params = "-f$from_email"; mb_language("uni"); $subject = mb_convert_encoding($subject, "UTF-8","AUTO"); $subject = mb_encode_mimeheader($subject); mail($to, $subject, $body, $headers, $sendmail_params); Link to comment https://forums.phpfreaks.com/topic/159338-sending-utf-8-email/ Share on other sites More sharing options...
Logical1 Posted May 25, 2009 Author Share Posted May 25, 2009 26 views 4 days later anot not a single suggestion?! Link to comment https://forums.phpfreaks.com/topic/159338-sending-utf-8-email/#findComment-841432 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.