I am using the following code to send email to members of my site. The script works and the email is recieved by the user. But, I do encounter encoding problems when emailing to Hotmail or Notes.
The code:
$to = "to@email.com";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/plain; charset="utf-8"; format="flowed"' . "\r\n";
$headers .= 'Content-Transfer-Encoding: 8bit'. "\n\r\n";
$headers .= "To: John Doe<john@doe.com>" . "\r\n" .
"From: John Smith<john@smith.com" . "\r\n" .
"Reply-To: john@doe.com" . "\r\n" .
"Return-Path: john@doe.com" . "\r\n" .
"Sender: john@doe.com" . "\r\n" .
"X-Sender: john@doe.com" . "\r\n" .
"X-Mailer: JohnDoe". "\r\n".
"X-Report-Abuse: Please report abuse to: john@doe.com";
//If the e-mail was successfully sent...
$subject = $translation[104];
if(mail($to, $subject, $message, $headers)){
}
Both the message and the subject contains the swedish letters Å, Ä and Ö. The actual message is correctly encoded and viewed in Hotmail, while the subject is not. You can view the image below for more information:
Image: http://www.aspkoll.se/imgo/649
I am confused. I've googled for days and tried different kind of solutions, but without any success I am afraid.
Can you please help me with this problem?
Appreciated!