Send unicode mail using HTML and PHP

The following PHP script resides on the server.

$msg =
      /* To     */ 'name@domain',
      /* Subject */ '=?UTF-8?B?' . base64_encode($_POST['subject']) . '?=',
      /* Message */ "<html><body><pre>{$_POST['message']}</pre></body></html>",
      /* Header  */ "MIME-Version: 1.0 Content-type: text/html; charset=UTF-8 From: {$_POST['from']} "
   ) ?
   'Your message was successfully sent' :
   'There was an error sending your message';

echo <<<EOT
<!DOCTYPE html>
window.location = "http://{$_SERVER[HTTP_HOST]}/{$_POST['url']}";
<p><a href="http://{$_SERVER[HTTP_HOST]}/{$_POST['url']}">Return to the page I was viewing</a></p>


An HTML form calls the PHP script, supplying it with the necessary information.

<form action="SendMail.php" method="post">
type="hidden" name="url" value="ContactMe.html" />
   <table style="padding:1em 1em; border-width:2px; border-style:groove">
Your e-mail address:</th><td><input type="email" name="from" size="60" /></td></tr>
selected>Make a donation</option>
Report an error</option>
colspan="2"><textarea name="message" rows="20" cols="58"></textarea></td></tr>
colspan="2" style="text-align:center"><br><button>Send</button></td></tr>
name@domainThe destination e-mail address.
SendMail.phpThe name of the PHP script.
ContactMe.htmlThe HTML page to return to on completion.

from, message, subject and url are the parameter names which are used by the form to transfer the information to the PHP script.
The names can be anything you like but obviously the script and the PHP must correspond.