norNerd Posted November 26, 2009 Share Posted November 26, 2009 Heres the header <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link href="style/style1.css" rel="stylesheet" type="text/css" /><title>TDR - Tolk døgnet rundt</title>And then some script apps and stylesheets here.</head> Then the PHP script <?phpif(isset($_POST['send'])){ $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $text_added = $_POST['text_added']; $text = "Melding fra: ".$_POST['name']." E-post: ".$_POST['email']." Emne: ".$_POST['subject']." $name skrev: ".$_POST['text_added'].""; $to = "nerd@norclick.com"; $thankyou_text = ""; mail("$to", "".$_POST['subject']."", "$text", "From: <".$_POST['email'].">"); mail("$email","Takk for henvendelsen","$thankyou_text","From: <$to>"); echo "<script>alert('Din henvendelse ble sendt til Tolk Døgnet Rundt.');</script>"; echo "<script>location.href='index.php?page=index';</script>";} ?> Know this code has some "security" issues but i think its best to get it to work before i add more code :)Anyone know why it send æ, ø, å like Ã?, Ã~, Ã. when i post message thru the form?Have had alot of truble with this before, and never found a solution that worked on all sites :sKris Link to comment Share on other sites More sharing options...
chibineku Posted November 26, 2009 Share Posted November 26, 2009 You can set some additional, optional mail headers which set content types, for example I use:$headers = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";But you will probably need to change it to$headers = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";Note that this allows the sending of html mail, you can swap text/html to text/plain if you don't need that option. Link to comment Share on other sites More sharing options...
norNerd Posted November 26, 2009 Author Share Posted November 26, 2009 Hi chibineku, thanks :)I changed code to: <?php $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; $thankyou_text = "Takk for hendevendelsen til oss i Tolk Døgnet Rundt. Vi tar kontakt etter vi har gått igjennom hendvendelsen. MVH Tolk Døgnet Rundt [url="http://tdr.no";"]http://tdr.no";[/url] mail("$to", "".$_POST['subject']."", "$text", "From: <".$_POST['email'].">", "$headers"); ?> And got the same problem, what am i doing wrong?Kris Link to comment Share on other sites More sharing options...
chibineku Posted November 26, 2009 Share Posted November 26, 2009 That was my sole idea, I'm afraid Link to comment Share on other sites More sharing options...
norNerd Posted November 26, 2009 Author Share Posted November 26, 2009 Hehe, no problem, will test your code on some other sites insted :)Kris Link to comment Share on other sites More sharing options...
justsomeguy Posted November 28, 2009 Share Posted November 28, 2009 Make sure your PHP file is also saved in UTF format, since the string is coming from that file. Also, check the examples on this page:http://www.php.net/manual/en/function.mb-send-mail.php Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.