Witam,
Mam wielka prosbe o pomoc. Mam teksty polskie w bazie danych. Po ich wstawieniu do tresci maila (mam skrypt, ktory pobiera tekst z bazy i wysyla na email w formacie html) polskie znaki diakrytyczne sa OK.
Niestety w temacie np. zamiast ś mam znaka akapitu (w Worda). Jak mozna poprawnie zakodowac polskie znaki w temacie. Prosze o pomoc.
Oto fragment kodu:
[php:1:5f6497b9fd]<?php
$mail = new multi_mail;
$mail->from = $conf['From'];
$mail->subject = $subject;
$mail->body = $body;
$mail->to = $ar[email];
$mail->send_mail();
----------------------------------------------------------------
Part of $mail class
function build_letter($header)
{
global $lng;
$letter = $header["content"];
if ($header["encode"] != "text/html"):
$letter = chunk_split(base64_encode($letter));
$encoding = "base64nContent-Location: http://lc-words.com/images/$lng/tlo.gif";
else:
$encoding = $header["encode"];
endif;
return "Content-Type: ".$header["encode"].
($header["name"]? "; name = "".$header["name"].""" :"").
"nContent-Transfer-Encoding: $encodingnn$lettern"; }
function set_multipart_mail()
{
$boundary = 'b'.md5(uniqid(time()));
$multipart = "Content-Type: multipart/related; boundary ="$boundary"; This is a MIME encoded letternn--$boundary"; for($step = sizeof($this->headers)-1; $step >=0; $step--)
{
$multipart .="n".$this->build_letter($this->headers[$step])."--$boundary";
}
return $multipart .= "--n";
}
function get_full_message()
{
$mime = "";
if (!empty($this->from)):
$mime .= "From: ".$this->from." n";
endif;
if (!empty($this->body)):
$this->body = ereg_replace("nn","n<p align=justify>",$this->body);
$this -> attach_file("",$this->body,"text/html");
$mime .= "MIME-Version: 1.0n".$this->set_multipart_mail();
endif;
return $mime;
}
function send_mail()
{
$mime = $this -> get_full_message(false);
if(!mail($this->to,$this->subject,"",$mime)) die('<h4>Bad mail configuration!</h4>'); }
?>[/php:1:5f6497b9fd]
Z gory bardzo wyszstkim dziekuje!