I found out how you do this, you will need to set UTF-8 in the mail itself and in extension both in the header of the mail (Subject and so on) and the message in the mail as well.
Heres a code sample that sends a mail to the customr and a copy to the seller:
// send user an email with a confirmation
$firstname = $_POST['first_name'];
$lastname = $_POST['last_name'];
$to = filter_var($_POST['payer_email'], FILTER_SANITIZE_EMAIL);
$to2 = filter_var($_POST['your@email.com'], FILTER_SANITIZE_EMAIL);
$subject = "Tack för Ert köp! / Thank you for your order!";
$subject2 = "(COPY) Tack för Ert köp! / Thank you for your order!";
$headerFields = array(
'Date: ' . date('r', $_SERVER['REQUEST_TIME']),
"Subject: =?UTF-8?Q?".imap_8bit($subject)."?=",
"From: {$to}",
"MIME-Version: 1.0",
"Content-Type: text/html;charset=utf-8"
);
$headerFields2 = array(
'Date: ' . date('r', $_SERVER['REQUEST_TIME']),
"Subject: =?UTF-8?Q?".imap_8bit($subject2)."?=",
"From: {$to}",
"MIME-Version: 1.0",
"Content-Type: text/html;charset=utf-8"
);
$message = "$firstname $lastname, $payer_email <br />
MESSAGE TO CUSTOMER;
$message2 = "$firstname $lastname, $payer_email <br />
MESSAGE TO CUSTOMER
(NOTE: THIS IS A COPY)";
mail($to, $subject, $message, implode("
", $headerFields));
mail($to2, $subject2, $message2, implode("
", $headerFields2));
}
What is happening is that the $headerFields "MIME-Version: 1.0", "Content-Type: text/html;charset=utf-8"
sets UTF-8 for the message of the mail. It even applies to the header except for the Subject that needs to be alone set to: "Subject: =?UTF-8?Q?".imap_8bit($subject)."?=",