Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Polskie znaki - nic nie pomaga
zbi213
post
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 21.03.2014

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


Jako że to mój pierwszy post na tym forum witam wszystkich serdecznie.
Od jakiegoś czsu przeglądam to forum i wiele razy znalazłem potrzebne rozwiązania ale
tym razem mam problem. Wiadomości dochodzą bez polskich znaków.
Wprawdzie tytuł wiadomości ma polskie znaki bo udało mi się to rozwiązać ale
treść i od kogo niestety nie.

<?php
}
else /* send the submitted data */
{
$name=$_REQUEST['your-name'];
$email=$_REQUEST['your-email'];
$mailsubject=$_REQUEST['your-subject'];
$message=$_REQUEST['your-message'];
if (($name=="")||($email=="")||($message==""))
{
echo "All fields are required, please fill <a href=\"\">the form</a> again.";
}
else{
$from="From: $name<$email>\r\nReturn-path: $email";
$subject=" ($mailsubject)";
$subject="=?UTF-8?B?".base64_encode($subject)."?=";
mail("biuro@technicstudio.pl", $subject, $message, $from);
echo "Twoja wiadomość została wysłana.";
}

?>


Jeśli jest ktoś w stanie mi pomóc to będą bardzo wdzięczny.

Ten post edytował zbi213 21.03.2014, 09:47:26
Go to the top of the page
+Quote Post
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




1) Uzywaj bbcode
2) W mailu masz okreslic ze jest on w UTF8. W manualu przy funkcji mail() napisali jak to zrobic.
Go to the top of the page
+Quote Post
zbi213
post
Post #3





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 21.03.2014

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


Dzięki za szybką odpowiedź lecz gdybyś mógł bardziej rozjaśnić bo niewiele wiem o kodowaniu a kod który wkleiłem
kupiłem wraz z e stroną i stąd mój problem.
Do niego dopisałe $subject="=?UTF-8?B?".base64_encode($subject)."?="; i to sprawiło że tytół
ma polskie znaki ale reszta niestety nie.
Go to the top of the page
+Quote Post
Turson
post
Post #4





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


Plik też musisz mieć w UTF-8
Go to the top of the page
+Quote Post
zbi213
post
Post #5





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 21.03.2014

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


Plik jest w UTF-8 ale to nic nie daje

Ten post edytował zbi213 21.03.2014, 10:04:43
Go to the top of the page
+Quote Post
nospor
post
Post #6





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Jak juz pisalem: zajrzyj do manuala
http://pl1.php.net/manual/en/function.mail.php
Tam masz napisane jak ustawic UTF8 dla CALEGO MAILA a nie tylko dla tematu
Go to the top of the page
+Quote Post
zbi213
post
Post #7





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 21.03.2014

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


nospor , dzięki za link (wcześniej nie zrozumiałem o co Ci chodzi) Znalazłem tam o polskich znakach ale
jestem za cienki żeby to ogarnąć.
Go to the top of the page
+Quote Post
nospor
post
Post #8





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




$from="Content-type: text/html; charset=utf-8\r\nFrom: $name<$email>\r\nReturn-path: $email";
Go to the top of the page
+Quote Post
zbi213
post
Post #9





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 21.03.2014

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


Częściowo pomogło bo treść już jest poprawnie niestety nazwa nadawcy nadal nie ma polskich znaków.
Go to the top of the page
+Quote Post
nospor
post
Post #10





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




No to nadawce zrob dokladnie tak samo jak zrobiles z tematem (subject)
Go to the top of the page
+Quote Post
zbi213
post
Post #11





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 21.03.2014

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


Niestety żadne zabiegi nie pomagają. Chyba nie wiem jak to zrobić albo gzie wstawić.
Próbowałem też usunąć pole '' Twoje imię" ale wtedy nie chce wysłać wiadomości.
Go to the top of the page
+Quote Post
trueblue
post
Post #12





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

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


Spróbuj dodać jeszcze te dwa nagłówki:
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Go to the top of the page
+Quote Post
zbi213
post
Post #13





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 21.03.2014

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


nie pomaga.
Go to the top of the page
+Quote Post
trueblue
post
Post #14





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

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


Ale $name nie koduj jak tematu.
Go to the top of the page
+Quote Post
zbi213
post
Post #15





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 21.03.2014

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


Wróciłem z pracy i próbuję dalej coś z tym zrobić lecz nadal nic.
Wkleję więcej kodu to może ktoś coś pomoże . Ewentualni jak
zrobić aby pole twoje imię nie było wymagane. Wtedy można by go usunąć i po
sprawie.

  1. <?php
  2.  
  3. $action=$_REQUEST['action'];
  4. if ($action=="") /* display the contact form */
  5. {
  6. ?>
  7.  
  8.  
  9. <div class="wpcf7" >
  10. <form action="contact.php" method="post" class="wpcf7-form" enctype="multipart/form-data">
  11. <input type="hidden" name="action" value="submit">
  12.  
  13. <p>Twoje Imię (wymagane)<br>
  14. <span class="wpcf7-form-control-wrap your-name">
  15. <input name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" aria-required="true" type="text">
  16. </span>
  17. </p>
  18.  
  19. <p>Twój Email (wymagane)<br>
  20. <span class="wpcf7-form-control-wrap your-email">
  21. <input name="your-email" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7-validates-as-email" aria-required="true" type="email">
  22. </span>
  23. </p>
  24.  
  25. <p>Temat (wymagane)<br>
  26. <span class="wpcf7-form-control-wrap your-subject">
  27. <input name="your-subject" value="" size="40" class="wpcf7-form-control wpcf7-text" type="text">
  28. </span>
  29. </p>
  30.  
  31. <p>Twoja Wiadomość (wymagane)<br>
  32. <span class="wpcf7-form-control-wrap your-message">
  33. <textarea name="your-message" cols="40" rows="10" class="wpcf7-form-control wpcf7-textarea"></textarea>
  34. </span>
  35. </p>
  36.  
  37. <p>
  38. input value="Wyślij" class="wpcf7-form-control wpcf7-submit" type="submit">
  39. </p>
  40. </form>
  41. </div>
  42.  
  43.  
  44. <?php
  45.  
  46. }
  47. else /* send the submitted data */
  48. {
  49. $name=$_REQUEST['your-name'];
  50. $email=$_REQUEST['your-email'];
  51. $mailsubject=$_REQUEST['your-subject'];
  52. $message=$_REQUEST['your-message'];
  53. if (($name=="")||($email=="")||($message==""))
  54. {
  55. echo "All fields are required, please fill <a href=\"\">the form</a> again.";
  56. }
  57. else{
  58. $from="Content-type: text/html; charset=utf-8\r\nFrom: $name<$email>\r\nReturn-path: $email";
  59. $subject=" ($mailsubject)";
  60. $subject="=?UTF-8?B?".base64_encode($subject)."?=";
  61. mail("biuro@technicstudio.pl", $subject, $message, $from);
  62. echo "Twoja wiadomość została wysłana.";
  63. }
  64. }
  65. ?>


Dzięki wszystkim za pomoc . Już zrobiłem
Go to the top of the page
+Quote Post
trueblue
post
Post #16





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

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


Spróbuj tak:
  1. else{
  2. $headers = 'MIME-Version: 1.0' . "\r\n";
  3. $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
  4. $headers .= 'From: '.$name.' <'.$email.'>'."\r\n";
  5. $headers .= 'Reply-To: '.$email."\r\n";
  6. $headers .= "Message-ID: <".(time().(rand(0,1000)))."TechnicStudio@".$_SERVER['SERVER_NAME'].">"."\r\n";
  7. $headers .= "X-Mailer: PHP v".phpversion()."\r\n";
  8.  
  9. $subject=" ($mailsubject)";
  10. $subject="=?UTF-8?B?".base64_encode($subject)."?=";
  11. mail("biuro@technicstudio.pl", $subject, $message, $headers);
  12. echo "Twoja wiadomość została wysłana.";
  13. }
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 17.09.2025 - 07:27