1

I have a website which sends a confirmation-email but since the website is in Danish I need a special character in the header of the mail (The letter "æ"). How do I do that without the code itself being part of the string?

I have tried putting http://www.w3.org/1999/xhtml' lang='da' xml:lang='da'> in the header but it thinks it's part of the string. In the $msg I have used it and it works because it takes it all as html. But I can't use that in the header. How can I work around that problem? Also, æ doesn't work.

function runMyFunction() {
                $msg = "<html xmlns='http://www.w3.org/1999/xhtml' lang='da' xml:lang='da'><meta http-equiv='content-type' content='text/html; charset=utf-8' /><body><p>Hej ".$_SESSION['brugernavn']."<br><br>Tak fordi du har oprettet dig som bruger.<br>Du bedes bekræfte din mail ved at åbne linket: <a href='http://example.dk/confirm.php?username=".$_SESSION['brugernavn']."&check=confirm'>Klik her</a><br><br>Hilsen example!</body></html>";
                $msg = wordwrap($msg,70);
                $headers = "MIME-Version: 1.0" . "\r\n";
                $headers .= 'From: <Support@example.dk>' . "\r\n";
                $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
                mail($_GET['resend'],"Bekræft E-mail hos example",$msg,$headers);
                echo "Der er blevet sendt endnu en bekræftelsesmail!";
            }

I want the header to say "Bekræft E-mail..." in the mail but it says "Bekræft E-mail..." instead.

0 Answers0