Přidat otázku mezi oblíbenéZasílat nové odpovědi e-mailem Problém s diakritikou - funkce MAIL PHP

Zdravím,
mám takový problém... dělám eshop, veškerá diakritika se ukazuje dobře (jak v db, tak na stránkách), ale když nechám odeslat mail s objednávkou, tak se mi z nějakýho důvodu nezobrazuje č a Č všechna ostatní diakritika se mi zobrazuje v pořádku... Setkal se s tím někdy někdo?

$predmet ='Objednávka';
require("inc/functions.php");
include("inc/class.html.mime.mail.inc");
$telo="<p font=arial>Rekapitulace objednávky<br> <b>Jméno: ".$jmeno."</b><br><table border=1><tr><td>Název</td><td>Cena</td></tr>".$zbozi."</table><table border=1><tr><td>Celková cena(včetně dopravy)</td><td>".$_SESSION["CCena"]."</td></tr></table>";
$komu='email@email.cz';
$komu2=$_POST["email"];
$mail = new html_mime_mail("X-Mailer: Html Mime Mail Class");
$mail->set_charset('utf-8', TRUE);
$mail->add_html(ToISO($telo), "");

$mail->build_message();
$mail->send($email, $komu, $komu, $predmet);
$mail->send($email, $komu2, $komu2, $predmet);
Předmět Autor Datum
Máš nesprávnu znakovú sadu. A tamto nie je php mail funkcia, ale nejaká vložená zbastlená, tak ju tr…
čitateľ 17.07.2016 17:24
čitateľ
{ $BName = "Konqueror"; $BVersion=$match[2]; } elseif(eregi("(lynx)/([0-9]{1,2}.[0-9]{1,2}.[0-9]{1,…
Johniiiiiiik1 17.07.2016 17:47
Johniiiiiiik1
function IsEmail ($text) { $text = strtolower($text); /* for ($i=1; $i<=strlen($text); $i++) { if (s…
Johniiiiiiik1 17.07.2016 17:49
Johniiiiiiik1
Nestudoval jsem to celé do detailů, ale co tohle? function ToISO ($text) { $iso = "µľ®»«ą©Ą"; $win…
host 17.07.2016 17:59
host
Dle všeho má být zrovna Č stejný pro oba :-(
Johniiiiiiik1 17.07.2016 18:02
Johniiiiiiik1
Pošli to k vode, použi PHPMailer, to je ako mercedes medzi php mail knižnicami
čitateľ 17.07.2016 18:15
čitateľ
Ale predtým si ešte zisti aspoň základné rozdiely medzi znakovými sadami, iso, win, unicode.. tamtá… poslední
čitateľ 17.07.2016 18:19
čitateľ
	{ 
	$BName = "Konqueror"; $BVersion=$match[2]; 
	} 
	elseif(eregi("(lynx)/([0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2})",$HTTP_USER_AGENT,$match)) 
	{ 
	$BName = "Lynx "; $BVersion=$match[2]; 
	} 
	elseif(eregi("(links) \(([0-9]{1,2}.[0-9]{1,3})",$HTTP_USER_AGENT,$match)) 
	{ 
	$BName = "Links "; $BVersion=$match[2]; 
	} 
	elseif(eregi("(msie) ([0-9]{1,2}.[0-9]{1,3})",$HTTP_USER_AGENT,$match)) 
	{ 
	$BName = "MSIE "; $BVersion=$match[2]; 
	} 
	elseif(eregi("(netscape6)/(6.[0-9]{1,3})",$HTTP_USER_AGENT,$match)) 
	{ 
	$BName = "Netscape "; $BVersion=$match[2]; 
	} 
	elseif(eregi("mozilla/5",$HTTP_USER_AGENT)) 
	{ 
	$BName = "Netscape"; $BVersion="Unknown"; 
	} 
	elseif(eregi("(mozilla)/([0-9]{1,2}.[0-9]{1,3})",$HTTP_USER_AGENT,$match)) 
	{ 
	$BName = "Netscape "; $BVersion=$match[2]; 
	} 
	elseif(eregi("w3m",$HTTP_USER_AGENT)) 
	{ 
	$BName = "w3m"; $BVersion="Unknown"; 
	} 
	else{$BName = "Unknown"; $BVersion="Unknown";} 
	
	// System 
	if(eregi("linux",$HTTP_USER_AGENT)) 
	{ 
	$BPlatform = "Linux"; 
	} 
	elseif(eregi("win32",$HTTP_USER_AGENT)) 
	{ 
	$BPlatform = "Windows"; 
	} 
	elseif((eregi("(win)([0-9]{2})",$HTTP_USER_AGENT,$match)) || (eregi("(windows) ([0-9]{2})",$HTTP_USER_AGENT,$match))) 
	{ 
	$BPlatform = "Windows $match[2]"; 
	} 
	elseif(eregi("(winnt)([0-9]{1,2}.[0-9]{1,2}){0,1}",$HTTP_USER_AGENT,$match)) 
	{ 
	$BPlatform = "Windows NT $match[2]"; 
	} 
	elseif(eregi("(windows nt)( ){0,1}([0-9]{1,2}.[0-9]{1,2}){0,1}",$HTTP_USER_AGENT,$match)) 
	{ 
	$BPlatform = "Windows NT $match[3]"; 
	} 
	elseif(eregi("mac",$HTTP_USER_AGENT)) 
	{ 
	$BPlatform = "Macintosh"; 
	} 
	elseif(eregi("(sunos) ([0-9]{1,2}.[0-9]{1,2}){0,1}",$HTTP_USER_AGENT,$match)) 
	{ 
	$BPlatform = "SunOS $match[2]"; 
	} 
	elseif(eregi("(beos) r([0-9]{1,2}.[0-9]{1,2}){0,1}",$HTTP_USER_AGENT,$match)) 
	{ 
	$BPlatform = "BeOS $match[2]"; 
	} 
	elseif(eregi("freebsd",$HTTP_USER_AGENT)) 
	{ 
	$BPlatform = "FreeBSD"; 
	} 
	elseif(eregi("openbsd",$HTTP_USER_AGENT)) 
	{ 
	$BPlatform = "OpenBSD"; 
	} 
	elseif(eregi("irix",$HTTP_USER_AGENT)) 
	{ 
	$BPlatform = "IRIX"; 
	} 
	elseif(eregi("os/2",$HTTP_USER_AGENT)) 
	{ 
	$BPlatform = "OS/2"; 
	} 
	elseif(eregi("plan9",$HTTP_USER_AGENT)) 
	{ 
	$BPlatform = "Plan9"; 
	} 
	elseif(eregi("unix",$HTTP_USER_AGENT) || eregi("hp-ux",$HTTP_USER_AGENT)) 
	{ 
	$BPlatform = "Unix"; 
	} 
	elseif(eregi("osf",$HTTP_USER_AGENT)) 
	{ 
	$BPlatform = "OSF"; 
	} 
	else{$BPlatform = "Unknown";} 

} 

?>
function IsEmail ($text) {
  	$text = strtolower($text);
  	/* for ($i=1; $i<=strlen($text); $i++)
  	{
    	if (strpos("abcdefghijklmnopqrstuvwxyz0123456789@.-_", substr($text, $i, 1)) === false)
    	{
			return false;
    	}
  	} */
	if (strlen($text) < 6)
	{
    	return false;
  	}
	if (strpos($text, "@") != strrpos($text, "@"))
	{
    	return false;
  	}
	if ((strpos($text, "@") < 1) || (strpos($text, "@") > (strlen($text) - 4)))
	{
    	return false;
  	}
	if (strrpos($text, ".") < strpos($text, "@"))
	{
    	return false;
  	}
	if (((strlen($text) - strrpos($text, ".") - 1) < 2) || ((strlen($text) - strrpos($text, ".") - 1) > 3))
	{
    	return false;
  	}
	return true;
} 

// převod znakové sady win-1250 na iso
function ToISO ($text) {
	$iso = "µľ®»«ą©Ą";
	$win = "ľžŽťŤšŠĽ";


	for ($i=1; $i<=strlen($win); $i++)
  	{
    	$text = str_replace(substr($win,$i-1,1), substr($iso,$i-1,1), $text);
  	}
  	return $text;
}

// náhrada funkce str_repeat
function StrRepeat ($text, $num) {
	for ($i=1; $i<=$num; $i++) { $temp = $temp . $text; }
	return $temp;
} 

// funkce mysql_query s výpisem případné chyby
function MySqlQuery ($query) {
	$sql_result = mysql_query($query);
	if (!$sql_result) {
		echo "<p><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\"><font color=\"Red\"><b>MySQL Error</b></font> - ";
		echo mysql_errno().": ".mysql_error()."</font></p>";
	}
	return $sql_result;
} 

// převod do kódování MIME
function ToMIME ($text) {
	for ($i=1; $i<=strlen($text); $i++)
	{
    	if (ord(substr($text,$i-1,1)) == 61)
	    {
	    	$temp = $temp . "=3D";
		}
	    elseif (ord(substr($text,$i-1,1)) < 128)
	    {
			$temp = $temp . substr($text,$i-1,1);
	    }
		else
	    {
			$temp = $temp . "=" . substr(dechex(ord(substr($text,$i-1,1))), strlen(dechex(ord(substr($text,$i-1,1)))) - 2);
	    }
	} 
	return $temp;
}

// vrátí time +/- Den,Měsíc,Rok
function ConvertDate ($mounth, $day, $year) {
	$temp  = mktime (0,0,0,date("m")+$mounth  ,date("d")+$day,date("Y")+$year);
	return $temp;
}

Zpět do poradny Odpovědět na původní otázku Nahoru