Jump to content

php mail with greek characters


papag

Recommended Posts

Hello everyone at phpfreaks!!

 

This is my first post here, so you can tell i' m a rookie php  programmer  :)

 

I have a problem sending php mails with greek characters (the greek language is not script-friendly at all...).

The code :

 

// subject

$subject = 'Αποστολή κειμένου από την τοποθεσία www.katsoulakis.gr';

// message

$message = $subject . "\r\n";

$message .= 'Από : ' . $sname . "\r\n";

$message .= 'E-mail : ' . $smail . "\r\n";

$message .= 'Προς : ' . $rname . "\r\n";

$message .= 'E-mail : ' . $rname . "\r\n";

$message .= 'Μήνυμα : ' . $stext . "\r\n";

$message .= 'Τίτλος κειμένου : ' . $title . "\r\n";

$message .= 'Κείμενο : ' . $msg . "\r\n";

// Additional headers

$headers = "\r\n";

$headers .= "MIME-Version: 1.0\r\n";

$headers .= "Content-type: text/plain; charset=UTF-8\r\n";

$headers .= "\n\n";

// Mail it

mail($to, $subject, $message, $headers);

 

The problem is that when the receiver gets the mail, instead of what 's supposed to see, gets $&%%^*%#^#$%^ chars....

if i change the character encoding (on Thunderbird) it's all ok, but not everyone knows how to do it....

So the question is  :

How can i send the mail and read it without changing the default encoding? (i' ve tried to send a "charset=ISO-8859-7" header but still needs to change the encoding on Thunderbird to UTF-8 - same happens in outlook...)

The page URL is http://www.katsoulakis.gr/sendmail.php?id=9 (It' s all in greek though...). Also the page is UTF-8 encoded.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/113315-php-mail-with-greek-characters/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.