RE: Kodovani v emailech

From: Thirsty <thirsty (zavinac)>
Date: 04. 02. 2004, 22:28 CET
      kratce nastinim svuj problem :
> 
>       - formular, ktery ma nastavene kodovani na win-1250, odeslu php
> skriptem se zpravou, ktera obsahuje ceske znaky (diakritiku)
> 
>       - server form zpracuje a odesle na mail uvedeny ve skriptu
> 
>       - na vystupu v postovnim klientovi se bud nektere ceske znaky bud
> ztrati uplne, nebo se zmeni v neco nesmyslneho
> 
>       Potreboval bych poradit, jak tenhle problem odstranit a pritom
> cestinu zachovat. Odkazte me na prosim materialy popisujici tuto
> problematiku...
> 
>       Terr
> 
> 
S uspechem pouzivam tohle:

function CZMail($to, $subj, $text, $headers = "")
{
  // prevedeni z windows-1250 do iso-8859-2 (pokud je potreba)	
  $text = StrTr($text, 
  				"\x8A\x8D\x8E\x9A\x9D\x9E", 
  				"\xA9\xAB\xAE\xB9\xBB\xBE");
  // prekodovani do Base64  
  $text = Base64_Encode($text);
  // pridani hlavicek
  $headers .= "MIME-Version: 1.0\r\n".
              "Content-Type: text/plain; charset=\"iso-8859-2\"\r\n".
              "Content-Transfer-Encoding: base64\r\n";
  // odeslani e-mailu              
  return Mail($to, $subj, $text, $headers);
}

Thirsty
Received on Wed, 4 Feb 2004 22:28:57 +0100

This archive was generated by hypermail 2.1.8 : 04. 02. 2004, 22:28 CET