Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [HTML][PHP] Mailing problem z polskimi znakami
Forum PHP.pl > Forum > Przedszkole
chairles
  1.  
  2. <?php
  3.  
  4. $imgName = "test.jpeg";
  5. $bigJPG;
  6. $smallJPG;
  7. $randValue;
  8. /*
  9.   $byteArray1 = $_REQUEST['myCapStream'];
  10.   $headline1 = $_REQUEST['headline'];
  11.   $mainText1 = $_REQUEST['mainText'];
  12. */
  13.  
  14.  
  15.  
  16.  
  17. //echo "ala".$headline."alal";
  18.  
  19. switch($_GET['action']) { //sprawdza zmienna action przekazana w linku (jaka operacja ma byc wykonana)
  20.  
  21. case 'savePic':
  22. savePicture($GLOBALS["HTTP_RAW_POST_DATA"]);
  23. break;
  24. case 'sendMail':
  25. sendEmail( $_REQUEST['email'],$_REQUEST['title'],$_REQUEST['text1'],$_REQUEST['text2'],$_REQUEST['text3'],$_REQUEST['dotText1'],$_REQUEST['dotText2'],$_REQUEST['dotText3']);
  26. break;
  27.  
  28. }
  29.  
  30. function savePicture($byteArray){
  31.  
  32.  
  33. $randValue = rand();
  34. $_SESSION['randValue']=$randValue;
  35. $bigJPG = "bigJPG_".$randValue.".jpeg";
  36. $fp = fopen("./capPics/".$bigJPG,"w")or die("can't open file");
  37.  
  38. fwrite( $fp, $byteArray);
  39. fclose($fp);
  40. /*
  41.   $img = imagecreatefromjpeg("http://made-in-china.livenet.pl/mailing/capPics/bigJPG_1706198673.jpeg")
  42.  
  43.   $sW = imagesx($img);
  44.   $sH = imagesy($img);
  45.   $tempImg = imagecreatetruecolor(650, 810);
  46.   imagecopyresampled($tempImg, $img, 0, 0, 0, 0, 650, 810, $sW, $sH);
  47.   imagejpeg($tempImg, "resized".$randValue);
  48.   */
  49. }
  50.  
  51. function sendEmail($email,$title,$text1,$text2,$text3,$dotText1,$dotText2,$dotText3){
  52. //$msg = "text1=".$text1<br>." text2= ".$text2<br>."aasas".<img src = 'capPics/'.$bigJPG >;
  53. $randValue = $_SESSION['randValue'];
  54. //$pic = <img src="http://www.made-in-china.livenet.pl/mailing/capPics/bigJPG_1277522297.jpeg">
  55. $msg ="
  56. <title>KingSquare</title>
  57. <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
  58. <table align='center' border='0' cellpadding='0' cellspacing='0'>
  59. <tbody width='651' height='1190'><tr>
  60. <td colspan='2' height='414' width='651'> <div style=\" width:100%; float:left; position:relative;\">
  61. <img src=\"http://king-dom.com.pl/mailing/KingSquare_01.jpg\"/>
  62. <p style=\"position:absolute; bottom:0px; left:20px; width:420px; font-size:20px; color:#fff; letter-spacing:-1px; font-family:Verdana, Geneva, sans-serif\">Mamy zaszczyt zaproponować Państwu przestrzeń handlową w nowej krakowskiej galerii.</p>
  63. </div></td>
  64. </tr>
  65. <tr>
  66. <td style='font-family: tahoma,arial,helvetica,sans-serif; font-weight: bold;' height='273' valign='top' width='415'>
  67. <br>
  68. <ul style='margin: 14px; padding: 0px;'>
  69. <li><font size='3'>$dotText1<br></font></li>
  70. <li><font size='3'>$dotText2<br></font></li>
  71. <li><font size='3'>$dotText3
  72. <br><br>
  73. </a><a style='font-family: tahoma,arial,helvetica,sans-serif; font-weight: normal; color: rgb(204, 0, 0);' href='http://king-dom.com.pl' target='blank'><font size='2'>www.king-dom.com.pl ť</font>
  74. </a></td>
  75. <td height='273' width='236'>
  76. <img src='http://king-dom.com.pl/mailing/KingSquare_03.jpg'></td>
  77. </tr>
  78. <tr>
  79. <td colspan='2' height='87' width='651'>
  80. <p style=\"width:611px; float:left; text-align:center; font-size:20px; border-bottom:1px solid #333; border-top:1px solid #333; padding:20px; color:#333; letter-spacing:-1px; font-family:Verdana, Geneva, sans-serif\">Poniżej zamieszczamy propozycje lokali, które, naszym zdaniem najlepiej odpowiadają specyfice Państwa firmy.</p></td>
  81. </tr>
  82. <tr>
  83. <td colspan='2' height='416' width='651'>
  84. <a style='font-family: arial,helvetica,sans-serif;' href='http://king-dom.com.pl/mailing/King_Square_Oferta_01.gif' target='blank'>
  85. <img src='http://king-dom.com.pl/mailing/KingSquare_05.gif' border='0'>
  86. </a><br style='font-family: arial,helvetica,sans-serif;'><span style='font-family: arial,helvetica,sans-serif;'>
  87. <font size='2'><font style='font-weight: bold; color: rgb(204, 0, 0);' size='3'>$text2</font>, $text3.</font></span><br><br style='font-family: arial,helvetica,sans-serif;'><a style='font-family: tahoma,arial,helvetica,sans-serif; font-weight: normal; color: rgb(204, 0, 0);' href='http://www.made-in-china.livenet.pl/mailing/capPics/bigJPG_$randValue.jpeg' target='blank'><font style='font-family: arial,helvetica,sans-serif;' size='2'>zobacz mapkę w większym formacie ť</font></a><br><a style='font-family: tahoma,arial,helvetica,sans-serif; font-weight: normal; color: rgb(204, 0, 0);' href='http://king-dom.com.pl/mailing/King_Square_Oferta_01.gif' target='blank'>&nbsp;<br><br>
  88. </a></td>
  89. </tr>
  90. </tbody></table>";
  91. $msg = html_entity_decode(iconv("ISO-8859-2","UTF-8",$msg));
  92. $odbiorca = $email;
  93. $temat = $title;
  94. $headers = 'MIME-Version: 1.0' . "\r\n";
  95. $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
  96. mail($odbiorca, $temat, $msg, $headers);
  97.  
  98.  
  99. }
  100.  
  101. ?>
  102.  
  103.  


Wysylam maila z contentem html'owym , jest chyba jakis problem z kodowaniem bo zamiast polskich znakow mam krzaki , moze ktos na to spojrzec prosze.
erix
A przeglądałeś przyklejony temat o polskich znakach? Był już wątek o kodowaniu w mailach.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.