Some special characters won't display right using mail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
nakkeli
Forum Newbie
Posts: 15
Joined: Thu Apr 10, 2008 1:18 am

Some special characters won't display right using mail

Post by nakkeli »

Hi

I am trying to create a feedback form, but when you send some special characters using it, they won't display right. Special characters meaning Ä, ä, Ö, ö, Å, å... etc. When I insert "Ä" into this, mail shows up like "Ä". "ä" is "ä" and so on. Any ideas?

Code: Select all

 
if (isset($_POST['btnsubmit'])) {
 
  $feedback = $_POST['feedback'];
  $feedback = strip_tags($feedback);
 
  $message = "Feedback: " . $feedback;
 
  $to= 'he-man@eterniapostoffice.com';
  $subject = 'Site Feedback';
 
  if (mail ($to, $subject, $message)) {
    echo "Message sent.<br />";
  } else {
    echo "Cannot send message.<br />";
  }
 
} else {
 
?>
 
<form action="feedback.php" method="post">
 
<b>Feedback:</b><br />
<textarea name="feedback" cols="45" rows="5"></textarea><br />
<br />
<input name="btnreset" type="reset" value="Reset" />&nbsp;
<input name="btnsubmit" type="submit" value="Submit" />
 
</form>
 
<?php
 
}
 
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Some special characters won't display right using mail

Post by Kieran Huggins »

it's a character encoding issue - if you specify the charset as UTF-8 your accented characters should appear fine.
Post Reply