rvdb86 Posted January 24, 2009 Share Posted January 24, 2009 hey, I created a script that will email a customer the information they filled out in a form. The content contains hebrew. When i send the email to my gmail email account it displays correctly, however when i send th email to my email account i have setup with microsoft outlook, the hebrew content appears as gibirish ??? heres my code: //// Email the person. //$Name = "Company"; //senders name //$email = "[email protected]"; //senders e-mail adress $recipient = $_POST['email']; //recipient $mail_body = " <html> <head> <title>Account Activation</title> </head> <body> <table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\"> <tr> <td><img src=\"http://www.company.com/members/images/logo.png\" width=\"250\" height=\"40\" /></td> <td align=\"right\" valign=\"middle\" class=\"HeaderLinks\"> <a href=\"\" class=\"HeaderLinks\">מרכז תמיכה</a> | התקשרו עכשיו <span style=\"color: #9fbb00;\">1-800-844-844</span> </td> </tr> <tr> <td colspan=\"2\" align=\"center\"> </td> </tr> <tr> <td colspan=\"2\" align=\"center\"> <img src=\"http://www.company.com/members/images/line.gif\" width=\"702\" height=\"1\" /> </td> </tr> <tr> <td colspan=\"2\"> <p>שלום $_POST[firstname] $_POST[lastname]</p> <p>Your account has been created! </p> <p>please click the following link to active your website:<br /> <a href=\"www.company.com/activation.php?account=$_POST[name]&site=$temp_site_id&status=1&user=$_POST[email]&id=$val_string\">www.company.com/activation.php?account=$_POST[name]&site=$temp_site_id&status=1&user=$_POST[email]&id=$val_string</a></p> </td> </tr> <tr> <td colspan=\"2\"> <p>Your personal login details are as follows:</p> <p> <b>username:</b> $_POST[email]<br /> <b>password:</b> $_POST[password]</p> <p>You can change your password at any time through your control panel.</p> </td> </tr> <tr> <td colspan=\"2\"> <p>If you have any problems, feel free to contact us</p> <p><b>Customer Services</b><br /> </p> </td> </tr> </table> </body> </html>"; $subject = "Account Activation and Details"; //subject $headers = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; ini_set('sendmail_from', '[email protected]'); mail($recipient, $subject, $mail_body, $headers); //mail command I really hope someone can help me out! Quote Link to comment https://forums.phpfreaks.com/topic/142244-php-hebrew-emails/ Share on other sites More sharing options...
.josh Posted January 24, 2009 Share Posted January 24, 2009 I don't really have a whole lot of experience in character sets, but I'd personally try specifying the hebrew charset in your email header. charset=iso-8859-8 and/or charset=windows-1255 afaik you can't specify multiple charsets in an email header. Since it looks like you are using mixed charsets, you can try using charset=UTF-8 Quote Link to comment https://forums.phpfreaks.com/topic/142244-php-hebrew-emails/#findComment-745249 Share on other sites More sharing options...
haku Posted January 24, 2009 Share Posted January 24, 2009 utf-8 support in email clients is sporadic. And even if they support it, often they won't display the mail in utf-8 by default, and require the receiver to switch it manually. I don't know about hebrew emails, but with Japanese emails, it was a matter of choosing the right charset. I use ISO-2022-JP. There must be a hebrew charset that is quite consistent across email clients. When testing, I usually test on outlook, thunderbird, hotmail, gmail and my cell phone. Unfortunately , I've not had a mac to test with. Crayon Violent was right about adding the charset to the header, but the text (both subject and body) has to be encoded in that charset as well for it to work. Quote Link to comment https://forums.phpfreaks.com/topic/142244-php-hebrew-emails/#findComment-745260 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.