Reply to correctly getting utf8 characters in the content of an e-mail

Your name:

Reply:


Posted by lionel on 08/09/07 08:12

Hi,

The HTML of my website is produced in UTF-8.
I've got a contact form with a simple textearea.

When I send this text :
----------------
This is some text
with a second line
----------------

My PHP script sends it ($message) by e-mail :

mail('me@localhost', 'message from contact', utf8_decode($message)) ;

This is what I get in the e-mail :

This is some textwith a second line

I can't get the "\n" character.

I also tried this way :

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail('me@localhost', 'message from contact', utf8_decode(nl2br($message)),
$headers) ;

I still get the same thing :

This is some textwith a second line

How can I get the "\n" of the message correctly ?

Thank you in advance,

:: Lionel ::

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация