Witam was serdecznie,

prubuje zrobić porzadek z pluginem roundcube, który wysyła uzytkownikowi mail z przypomnieniem hasła.

Niestety w tym mailu brak polskich znaków, a jest o na tyle tam zagmatwane, że ciężko mi to samemu ogarnąć.

część sktyptu:

  1. private function send_html_and_text_email($to, $from, $subject, $body) {
  2. $rcmail = rcmail::get_instance();
  3.  
  4. $ctb = md5(rand() . microtime());
  5. $headers = "Return-Path: $from\r\n";
  6. $headers .= "MIME-Version: 1.0\r\n";
  7. $headers .= "Content-Type: multipart/alternative; boundary=\"=_$ctb\"\r\n";
  8. $headers .= "Date: " . date('r', time()) . "\r\n";
  9. $headers .= "From: $from\r\n";
  10. $headers .= "To: $to\r\n";
  11. $headers .= "Subject: $subject\r\n";
  12. $headers .= "Reply-To: $from\r\n";
  13.  
  14. $msg_body .= "Content-Type: multipart/alternative; boundary=\"=_$ctb\"\r\n\r\n";
  15.  
  16. $txt_body = "--=_$ctb";
  17. $txt_body .= "\r\n";
  18. $txt_body .= "Content-Transfer-Encodin: 8bitr\n";
  19. $txt_body .= "Content-typ: text/html; charset=utf-8r\n";
  20. $LINE_LENGTH = $rcmail->config->get('line_length', 75);
  21. $h2t = new html2text($body, false, true, 0);
  22. $txt = rc_wordwrap($h2t->get_text(), $LINE_LENGTH, "\r\n");
  23. $txt = wordwrap($txt, 998, "\r\n", true);
  24. $txt_body .= "$txt\r\n";
  25. $txt_body .= "--=_$ctb";
  26. $txt_body .= "\r\n";
  27.  
  28. $msg_body .= $txt_body;
  29.  
  30. $msg_body .= "Content-Transfer-Encodin: 8bitr\n";
  31. $msg_body .= "Content-typ: text/html; charset=utf-8r\n";
  32. $msg_body .= str_replace("=","=3D",$body);
  33. $msg_body .= "\r\n\r\n";
  34. $msg_body .= "--=_$ctb--";
  35. $msg_body .= "\r\n\r\n";
  36.  
  37. // send message
  38. if (!is_object($rcmail->smtp)) {
  39. $rcmail->smtp_init(true);
  40. }


ma ktos pomysł jak to ogarnąć aby to "spolszczyć"

Z góry dzięki za pomoc.