I would like to insert special characters in the subject of HTML e-mails sent with the PHP mail() function.
I want my subject to look like this:
★ Yo
$headers="";
$message = utf8_encode($message);
$message = wordwrap($message, 70, "\r\n");
$subject = '=?UTF-8?B?'.base64_encode(utf8_encode($subject)).'?=';
$to_name = '=?UTF-8?B?'.base64_encode(utf8_encode($to_name)).'?=';
$from_name = '=?UTF-8?B?'.base64_encode(utf8_encode($from_name)).'?=';
$headers .= "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/plain; charset=utf-8" . "\r\n";
//$headers .= "Content-Transfer-Encoding: quoted-printable" . "\r\n";
$headers .= "From: $from_name <$from_email>" . "\r\n";
$headers .= "To: $to_name <$to_email>" . "\r\n";
$headers .= "Subject: $subject" . "\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
mail("", $subject, $message, $headers);