I send letters through the mail function (I tried the same thing through PHPmailer), some of the text of the letter is not substituted in the normal encoding, and another part in some unknown encoding.
Code:
$to = 'info@site.ru'; $hd="Content-Type: text/html; charset=utf-8\r\n"; $hd.="From: SITE.RU <info@site.ru>\r\n"; $hd.="X-Mailer: PHP/".phpversion()."\r\n"; $subject = 'Вам назначили задачу "'.$myrow_tasks['title'].'"!'; $mess=' <table cellpadding="0" cellspacing="0" border="0" align="center" style="margin:0;padding:0;width:700px;line-height:100%;border-collapse:collapse"> <tbody> <tr> <td valign="top" style="border-collapse:collapse"> <table cellpadding="5" cellspacing="0" border="0" align="center" style="background-color:#49769c;width:100%;color:white;font-family:sans-serif;margin-top:10px;padding:8px;border-collapse:collapse"> <tbody> <tr> <td width="115" height="50" valign="middle" style="border-collapse:collapse;margin:10px;"> <img src="http://site.ru/images/logo-150x47.png" alt="PLP" width="107" style="outline:none;margin:10px;text-decoration:none;display:block"> </td> <td width="200" valign="middle" style="padding-left:20px;border-collapse:collapse">- система обработки клиентов с вашего сайта</td> <td width="400" valign="middle" style="text-align:right;border-collapse:collapse"> <div style="margin-right:20px"> <a href=http://account.site.ru/login/ style="color:white" target="_blank">Вход в личный кабинет</a> </div> </td> </tr> </tbody> </table> <table cellpadding="0" cellspacing="0" border="0" align="center" style="border-collapse:collapse"> <tbody><tr> <td width="600" height="300px"; valign="middle" style="border-collapse:collapse"> <div style="margin:20px 10px"> Здравствуйте! <br><br> <h2>Вам поставили задачу "'.$myrow_tasks['title'].'".</h2> <br><br> Статус: '.$status_tasck.' <br><br> Дата начала: '.new_time(strtotime(''.$myrow_tasks['start_date'].' '.$myrow_tasks['start_time'].'')).' <br><br> Дата дедлайна: '.new_time(strtotime(''.$myrow_tasks['end_date'].' '.$myrow_tasks['end_time'].'')).' <br><br> Дата дедлайна: '.$myrow_tasks['description'].'; <br><br> <i style="color:#666">С уважением, команда сервиса SITE!</i> </div> </td> </tr> </tbody> </table> </td> </tr> <tr> <td valign="top" style="border-collapse:collapse"> <table cellpadding="5" cellspacing="0" border="0" style="background-color:#49769c;width:100%;color:white;font-family:sans-serif;margin-top:10px;border-collapse:collapse"> <tbody> <tr> <td valign="middle" align="left" style="width:130px;border-collapse:collaps;padding-left:20px;"> Присоединяйтесь: </td> <td valign="middle" align="left" style="width:35px;border-collapse:collapse;padding-left:5px;"> <a href="https://vk.com/" target="_blank" style=" padding-right:5px;"><img src="http://site.ru/images/vk_30px.jpg" alt="Вконтакте" width="30px" border="0" style="margin:5px;outline:none;text-decoration:none;" /></a> </td> <td valign="middle" align="left" style="width:35px;border-collapse:collapse;padding-left:5px;"> <a href="https://www.facebook.com/" target="_blank"><img src="http://site.ru/images/fb_30px.jpg" alt="FaceBook" width="30px" border="0" style="margin:5px;outline:none;text-decoration:none;" /></a> </td> <td valign="middle" align="left" style="width:35px;border-collapse:collapse;padding-left:5px;"> <a href="https://twitter.com/" target="_blank"><img src="http://site.ru/images/tw_30px.jpg" alt="Twitter" width="30px" border="0" style="margin:5px;outline:none;text-decoration:none;" /></a> </td> <td valign="middle" align="left" style="width:500px;border-collapse:collapse;padding-left:5px;"> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table>'; mail ($to,$subject,$mess,$hd); 