Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Polskie znaki w mail()
BuncolPL
post
Post #1





Grupa: Zarejestrowani
Postów: 75
Pomógł: 0
Dołączył: 19.12.2008
Skąd: Poland

Ostrzeżenie: (0%)
-----


Witam,

Mam pewien kłopot z kodowaniem polskich znaków w funkcji mail(). Dokładnie chodzi o sam temat wiadomości, w treści jest ok. Z tego co zauważyłem w większości programów pocztowych (Apple Mail, The Bat, Outlook) oraz w panelu pocztowym o2.pl z kodowaniem w temacie wiadomości nie ma problemów. Problem pojawia się w panelach poczta.nazwa.pl czy poczta.home.pl. Tam w temacie wiadomości pojawiają się krzaki :/

Możecie coś poradzić ?

Kod wygląda tak:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  3. <head>
  4. <meta http-equiv="Content-Language" content="pl" />
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. </head>
  7. <body>
  8. <?php
  9. // multiple recipients
  10. $to = 'kontakt@adres.pl';
  11.  
  12. // subject
  13. $subject = 'Polskie ąęćź';
  14.  
  15. // message
  16. $message = '
  17. <html>
  18. <head>
  19. <title>Birthday Remąężinders for August</title>
  20. </head>
  21. <body>
  22. <p>Heresąććś are the birthdays upcoming in August!</p>
  23. <table>
  24. <tr>
  25. <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
  26. </tr>
  27. <tr>
  28. <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
  29. </tr>
  30. <tr>
  31. <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
  32. </tr>
  33. </table>
  34. </body>
  35. </html>
  36. ';
  37.  
  38. // To send HTML mail, the Content-type header must be set
  39. $headers = 'MIME-Version: 1.0' . "\r\n";
  40. $headers .= "Content-Type: text/html;charset=utf-8\n";
  41. $headers .= "Content-Transfer-Encoding: 8bit\n";
  42. $headers .= "X-Mailer: PHP/" . phpversion(). "\r\n";
  43.  
  44.  
  45. // Additional headers
  46. $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
  47.  
  48.  
  49. // Mail it
  50. mail($to, $subject, $message,$headers);
  51. ?>
  52. </body>
  53. </html>


--------------------
:)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 21:23