Jump to content

mail() Pear, utf 8, hebrew charcters problem.


ShaKeD

Recommended Posts

Hey to all,

 

I`m trying to send mail, with http://pear.php.net/package/Mail.

my functions page formatted as ASCI UTF8 without BOM (using notepad++) and when I make my email, my header is

$utf8h = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";

when I return my $html I use

return iconv("UTF-8", "ISO-8859-8", $html);

and then send my email:

 

preparing to send:

$html = build_newsletter($values);
$text = 'Text version of email';

// sends it to the clients list:
require_once('Mail.php');
require_once('Mail/mime.php');
global $websiteName;
$today = date("d/m/Y");
$hdrs = array(
              'From'    => "$websiteName mail <newsletter@".str_replace(" ","","$websiteName").".co.il>",
              'Subject' => "[$today] ניוזלטר מאתר $websiteName: {$values['title']}",
		 'Content-type' => 'text/plain; charset=iso-8859-1'
              //str_replace(" "," ","[$today] ניוזלטר מאתר $websiteName: {$values['title']}")
);
$crlf = "\n";
$mime = new Mail_mime($crlf);

$mime->setTXTBody($text);
$mime->setHTMLBody($html);

$body = $mime->get();
$hdrs = $mime->headers($hdrs);

$mail =& Mail::factory('mail');

//send our email!

$x = $mail->send($client_address, $hdrs, $html); 

 

sorry about my bad english

and thank you all for the help!

 

Shaked.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.