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= "hemaiat@123abc123.com"; $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); Quote Link to comment 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?! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.