Special characters not supported by Hotmail and Apple 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
fastforward
Forum Newbie
Posts: 7
Joined: Sun May 07, 2006 6:08 am

Special characters not supported by Hotmail and Apple Mail?

Post by fastforward »

Hi

I'm currently creating a website which sends HTML e-mails out to a few selected e-mail accounts. The system is working just fine, except Apple Mail and Hotmail (haven't tried in Outlook yet) doesn't support some special characters from my language: æøå. They are however supported in Gmail. Anyone know a workaround for this problem?

ex: æ = æ

My PHP code:

Code: Select all

<?php

// recipient and subject
$sendTo = $_POST["mortenkh@hotmail.com"];
$subject = $_POST["overskriftVar"];

// just some headers
$headers = "From: Panduro Hobby <info@panduro-hobby.dk> \r\n" . "MIME-Version: 1.0 \r\n" . "Content-type: text/html; charset=iso-8859-1 \r\n";
$headers .= "Reply-To: info@panduro-hobby.dk \r\n";
$headers .= "Return-path: " . $_POST["mailVar"];

// content
$message = $_POST["indholdVar"];

// if the message contains backslashes, they (the backslashes) are deleted
if (get_magic_quotes_gpc()) {
	$message = stripslashes($message); 
} 

// send
mail($sendTo, $subject, $message, $headers);

?>
HTML mail:

Code: Select all

<html>

<head>

<title>Macro-Design</title>

</head>

<body>

<table width="750px">

Kære Morten Kiehn Holst
<br><br>

<table width="100%" height="20px" bgcolor="#bdd8f6">Velkommen til vores lille lækre nyhedsbrev, her kan du læse om vores nyheder, idéer og andre spændende ting. </table>

<img src="http://macro-design.org/logo.jpg">

</table>

</body>

</html>
Thanks, and have a nice day :wink:
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I think this has to do with the charset you tell the app to use. I believe iso-8859-1 doesn't support some of the special characters that unicode does (or vice-versa). From time to time browsers are to blame for this as well, as some browsers don't support certain character sets.

You may want to look around for information on various charset types. Sorry I couldn't be of more help, but I am sure others here can be.

EDIT | I did a search for iso-8859-1 characters not showing properly and found a decent article with some information on charsets.
Last edited by RobertGonzalez on Mon May 22, 2006 11:42 am, edited 1 time in total.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Yeah you need an SMTP server with ESMTP that return 8BITMIME in it's EHLO response ;) You can check that by using telnet to connect to port 25 and typing EHLO then pressing enter.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Whu-huh?!?!?! Wow, that was some of the best technical speak I have ever read in such a compact package. :D
fastforward
Forum Newbie
Posts: 7
Joined: Sun May 07, 2006 6:08 am

Charset doesn't help

Post by fastforward »

@ Everah

I've tried to change the charset in my .php file, but it still doesn't work. (I used 'charset=ISO-8859-4')

Any other suggestions?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Sorry, my understanding of character-encoding is limited at best. Wish I could fo more for you, but I am sure there are other developers around here that have a much richer understanding of the character encoding types and what they can do.
Post Reply