Re: PHP mail() problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2007. 03. 20, kedd keltezéssel 10.54-kor Delta Storm ezt írta:
> Hi,
> 
> I'm having problem with character encoding in PHP mail functions.
> 
> CODE:
> $headers.= "Content-Type: text/html; charset=iso-8859-1";
> 		$headers .= "MIME-Version: 1.0 ";
> 		$headers .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
> 		$headers .="Content-Type: multipart/alternative; 
> boundary=0-92766976-1174383938=:29106";
> 		$to = "unix_master10@xxxxxxxxx";
> 		$subject = $_POST['cat'];
> 		$body = $_POST['text'];

you should check those values first before putting them into mail().
they can contain spammer tricks like putting newlines in the subject and
then cc header lines or something similar....

> 		if (mail($to, $subject, $body, $headers))
> 		{
> 			echo('<p>Message successfully sent!</p><br /><a 
> href="showarticle.php?cid=5&id=3">Povratak</a>');
> 		}
> 		else
> 		{
> 			echo('<p>Message delivery failed...</p><br /><a 
> href="showarticle.php?cid=5&id=3">Povratak</a>');
> 		}
> 
> Im receiving mail as you see using yahoo.com. It all works except it 
> doesn't show croatian letters... I also tried with encoding utf-8, same 
> thing...
> ČĆŽŠĐ

what is the charset of the webpage displaying the form which triggers
this function? it must be set to the same value as the email otherwise
your email sending function won't receive the croatian letters at all,
so it cannot send them too...

hope that helps
Zoltán Németh

> 
> Please help, thank you very much!
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux