Scandinavian letters in email form
<p>I am having trouble getting the scandinavian letters ÆØÅ/æøå to work in my email form. The form sends the message and I recieve it just fine, except when there is ÆØÅ/æøå in the message.</p>

<p>Any help is highly appreciated!</p>

<pre><code>&lt;?php
header('Content-type: text/html; charset=utf-8');
$header = "Content-type: text/plain; charset=utf-8\r\n";

session_start();
ob_start();
$dontsendemail = 0;
$possiblespam = FALSE;
$strlenmessage = "";
$email = $_POST['email']; 
$message = $_POST['message'];
$subject = $_POST['subject'];


$emailaddress = array();
$emailaddress[1] = "lalala@lalala.lala";
    $emailaddress[2] = "lalala@llllaaa.laaaa";
    $emailaddress[3] = "laaaverksted@laa.verksted";
    $emailaddress[4] = "ess@xfrag.com";
    $contactnameindex = $_POST['emailaddress'];
if ($contactnameindex == 0 || !isset($_POST['emailaddress'])) echo '&lt;div id="notification" class="info_div"&gt;&lt;span class="ico_cancel"&gt;Du valgte ikke en mottaker.&lt;/span&gt;&lt;/div&gt;';
else $emailaddress = $emailaddress[$contactnameindex];
function checkcaptcha() {
        if ($_SESSION["pass"] != $_POST["userpass"]) {
            echo '&lt;div id="notification" class="info_div"&gt;&lt;span class="ico_cancel"&gt;Beklager, men feilet i å skrive inn bildeverifiseringen. Merk at bildeverifiseringen krever at du skiller imellom store og små bokstaver.&lt;/span&gt;&lt;/div&gt;';
            return 1;
        }
    }

function checkemail($field) {
// checks proper syntax
if( !preg_match( "/^([a-zA-Z0-9])+([a-zA-Z0-9._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9._-]+)+$/", $field))
{
    echo '&lt;div id="notification" class="info_div"&gt;&lt;span class="ico_cancel"&gt;Feilaktig e-postadresse registrert.&lt;/span&gt;&lt;/div&gt;'; 
    return 1;
}
}
function spamcheck($field) {
if(eregi("to:",$field) || eregi("cc:",$field) || eregi("\r",$field) || eregi("\n",$field) || eregi("%0A",$field)){ 
    $possiblespam = TRUE;
}else $possiblespam = FALSE;
if ($possiblespam) {
    echo '&lt;div id="notification" class="info_div"&gt;&lt;span class="ico_cancel"&gt;Mulig forsøk på spam oppdaget. Hvis dette ikke er tilfelle, kan du redigere innholdet i kontaktskjemaet, og prøv igjen.&lt;/span&gt;&lt;/div&gt;';
    return 1;
}
}
function strlencheck($field,$minlength,$whichfieldresponse) {
if (strlen($field) &lt; $minlength){
    die($whichfieldresponse); 
    return 1;
}
}

    if ($dontsendemail == 0) $dontsendemail = checkcaptcha($email);

if ($dontsendemail == 0) $dontsendemail = checkemail($email);
if ($dontsendemail == 0) $dontsendemail = spamcheck($email);
if ($dontsendemail == 0) $dontsendemail = spamcheck($subject);
if ($dontsendemail == 0) $dontsendemail = strlencheck($email,10,'&lt;div id="notification" class="info_div"&gt;&lt;span class="ico_cancel"&gt;E-mail feltet er for kort.&lt;/span&gt;&lt;/div&gt;');

if ($dontsendemail == 0) $dontsendemail = strlencheck($subject,5,'&lt;div id="notification" class="info_div"&gt;&lt;span class="ico_cancel"&gt;Emnefeltet er for kort.&lt;/span&gt;&lt;/div&gt;');

if ($dontsendemail == 0) $dontsendemail = strlencheck($message,10,'&lt;div id="notification" class="info_div"&gt;&lt;span class="ico_cancel"&gt;Meldingen er for kort.');
if ($dontsendemail == 0) $dontsendemail = strlencheck($emailaddress,8,'&lt;div id="notification" class="info_div"&gt;&lt;span class="ico_cancel"&gt;Du har ikke valgt en mottaker av meldingen.&lt;/span&gt;&lt;/div&gt;');
if ($dontsendemail == 0){mail($emailaddress, "Emne: $subject","Fra: $email", $message); echo '&lt;div id="sent" class="info_div"&gt;&lt;span class="ico_success"&gt;Takk! Din e-post til oss er registrert og vil bli besvart innen 24-timer på dagene Mandag-Fredag.&lt;/span&gt;&lt;/div&gt;'; }
ob_end_flush();
?&gt;
</code></pre>
