elnino_php Posted January 8, 2007 Share Posted January 8, 2007 I am new to PHP but have pt together a simple script to send of a mail. The problem is that when I receive the mail, I dont get the æøå characters.I have looked everywhere now and cant find an answer.Hope someone can help./MMy code<?$yourname = $_POST["yourname"]; /* nick name */$yourmail = $_POST["yourmail"]; $friendname = $_POST["friendname"]; $friendmail = $_POST["friendmail"]; $to = $_POST["friendmail"];$subject = "HiHi!";$body = "<html><head><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\"><title></title></head><body><TABLE HEIGHT=150 WIDTH=450 ><TR><TD WIDTH=150></TD><TD><i> æøåÆØÅ ". $friendname ." </i></TD></TR></TABle></body></html>";$headers = "From: Quiz man <[email protected]>\n";$headers .= 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";mail($to, $subject, $body, $headers); echo("Mail5 sendt"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/33398-cant-see-specail-chars-%C3%A6%C3%B8%C3%A5-in-my-php-mails/ Share on other sites More sharing options...
Daniel0 Posted January 8, 2007 Share Posted January 8, 2007 Try UTF-8 instead. That might work. Quote Link to comment https://forums.phpfreaks.com/topic/33398-cant-see-specail-chars-%C3%A6%C3%B8%C3%A5-in-my-php-mails/#findComment-156161 Share on other sites More sharing options...
sloshire1 Posted January 8, 2007 Share Posted January 8, 2007 Email programs can have difficulty reading special characters. Try using the html character codes for the special characters instead. You would have to look them up because they are not exactly human friendly, but they can look something like this:‡Hope this is what you are looking for, Quote Link to comment https://forums.phpfreaks.com/topic/33398-cant-see-specail-chars-%C3%A6%C3%B8%C3%A5-in-my-php-mails/#findComment-156164 Share on other sites More sharing options...
elnino_php Posted January 8, 2007 Author Share Posted January 8, 2007 Unfortunantly I cant check til I am back at work tommorrow. How do I change it to utf-8.I mean, it usually has no problems showing these characters... Quote Link to comment https://forums.phpfreaks.com/topic/33398-cant-see-specail-chars-%C3%A6%C3%B8%C3%A5-in-my-php-mails/#findComment-156166 Share on other sites More sharing options...
alpine Posted January 8, 2007 Share Posted January 8, 2007 Don't think utf-8 will work on those, try[code]<?php$text = str_replace(array("Æ","æ","Ø","ø","Å","å"),array("& # 198;","& # 230;","& # 216;","& # 248;","& # 197;","& # 229;"),$text);?>[/code]*EDIT* some problems getting them visually right displayed in this board... Remove the spaces in the code between "& # foo" Quote Link to comment https://forums.phpfreaks.com/topic/33398-cant-see-specail-chars-%C3%A6%C3%B8%C3%A5-in-my-php-mails/#findComment-156183 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.