开发者

email in iphone appears as jibberish

开发者 https://www.devze.com 2023-01-15 20:40 出处:网络
i\'m using phpmailer to send myself notifications on email. the email is in html and the body contains hebrew characters.

i'm using phpmailer to send myself notifications on email.

the email is in html and the body contains hebrew characters.

on my mac the email looks fine but on the iphone it appears as jibberish.

i tried every possible combination of encoding header both on the html head tag and as a property of the phpmailer but no luck.

any ideas?

thanks

how do i format the code??

require("./classes/phpmailer/class.phpmailer.php");

$mailer = new PHPMailer();

$mailer->IsSMTP();

$mailer->Host = 'ssl://smtp.gmail.com:465';

$mailer->SMTPAuth = TRUE;

$mailer->Username = 'bla@gmail.com'; // Change this to your gmail adress

$mailer->Password = '1234'; // Change this to your gmail password

$mailer->From = 'joe@gmail.com'; // This HAVE TO be your gmail adress

$mailer->FromName = 'Mail'; // This is the from name in the email, you can put anything you like here

$mailer->IsHTML(true);

$mailer->Body = $message;

$mailer->Subject = $subject;

$mailer->AddAddress('me@gmail.com'); // This is where you put the email adress of the person you want to mail if ($ma开发者_运维知识库iler->Send()) echo "ok";

else echo "no ok";


Be sure your email is being sent as UTF-8 with the proper headers and meta tags for best results when sending unicode email. If you don't explicitly specify that you are sending UTF-8, intermediary and receiving mail servers are free to make assumptions about the character set and encoding of the message.


I suggest you add a validation on top of your script that will check the client browser/OS, if OS=iphone then optimise your $message in an iphone-friendly format.

0

精彩评论

暂无评论...
验证码 换一张
取 消