Sending threads in Hebrew to php mail goes Klingon ...?

I am trying to send an email with the content and test in Hebrew:

$to = ' email@email.com '; $subject = "איזה יום יפה היום"; $message = 'ממש יום יפה'; $headers = 'From: email@email.com ' . "\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; mail($to, $subject, $message, $headers); 

But what I get in the subject is more Klingon than modern Hebrew. The message itself turned out to be beautiful, it's just a topic that everyone ruined.

What can I do? (I am open to any hacks that you have)

+4
source share
1 answer

Content-Type describes only the content of the message, but not the header. You need to apply encoded word encoding by Subject value. For more information, see my answer on the issue of encoding a PHP header topic .

+4
source

Source: https://habr.com/ru/post/1332767/


All Articles