x-store-info:4r51+eLowCe79NzwdU2kRyU+pBy2R9QCqSZKvP8JfO7icAucymF+ka+XWAITqcBnntptoXJBx6C8tQKBzzrcp8tOKG538QS3+nzQGUPVpfcyLSRH0uqRrBMda8Lw4gb8eC1XzgYHOgw=
Authentication-Results: hotmail.com; spf=permerror (sender IP is X.X.X.X) smtp.mailfrom=test@example.com; dkim=none header.d=fakefriends.ru; x-hmca=none header.id=robot@example.com
X-SID-PRA: robot@example.com
X-AUTH-Result: NONE
X-SID-Result: NONE
X-Message-Status: n:n
X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0wO0Q9MjtHRD0yO1NDTD02
X-Message-Info: 7FmAUICozusKIYYG508tgLajs+urb8pHFVfmmi+CJIrxseYqsZriZmYqTko2iSNAmj03zMgxV0zhk4FK/c2T7J+j8jF9EXQiKIT7Wkwv0QRviQiSkGq8Oe3xRkRmob2hIYsrgWvs2yKbOpavenxotlDODSraMAIOvoprvKS8d9k=
Received: from splXX.hosting.reg.ru ([X.X.X.X]) by BAY0-PAMC2-F8.Bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4900);
Thu, 25 Jul 2013 09:23:54 -0700
Received: by splXX.hosting.reg.ru (Postfix, from userid 10191)
id 6404B1440A89; Thu, 25 Jul 2013 20:23:53 +0400 (MSK)
To: =?KOI8-R?B?8M/ExMXS1svB?= <test@example.com>
Subject: =?KOI8-R?B?9MXT1CAoz9TQ0sHXydTFzNg6IPPF0sfFyik=?=
From: =?KOI8-R?B?88XSx8XK?= <robot@example.com>
Reply-To: test@example.com
X-Mailer: Drupal
MIME-Version: 1.0
Content-type: text/plain; charset=KOI8-R; format=flowed
Content-Transfer-Encoding: 8bit
Message-Id: <20130725162353.6404B1440A89@splXX.hosting.reg.ru>
Date: Thu, 25 Jul 2013 20:23:53 +0400 (MSK)
Return-Path: test@example.com
X-OriginalArrivalTime: 25 Jul 2013 16:23:54.0499 (UTC) FILETIME=[5B286D30:01CE8953]
<?php
function send_mime_mail (
$name_from, // имя отправителя
$email_from, // email отправителя
$name_to, // имя получателя
$email_to, // email получателя
$data_charset, // кодировка переданных данных
$send_charset, // кодировка письма
$subject, // тема письма
$body // текст письма
) {
$to = mime_header_encode($name_to, $data_charset, $send_charset). ' <' . $email_to . '>';
$subject = mime_header_encode($subject, $data_charset, $send_charset);
$from = mime_header_encode($name_from, $data_charset, $send_charset).' <' . $email_from . '>';
if($data_charset != $send_charset) {
$body = iconv($data_charset, $send_charset, $body);
}
$headers = "From: $from\r\n";
$headers .= "Reply-To: support@example.com\r\n";
$headers .= "Return-Path: support@example.com\r\n";
$headers .= "X-Mailer: Drupal\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= "Content-type: text/plain; charset=$send_charset; format=flowed\r\n";
$headers .= "Content-Transfer-Encoding: 8bit\r\n";
return mail($to, $subject, $body, $headers);
}
function mime_header_encode($str, $data_charset, $send_charset) {
if($data_charset != $send_charset) {
$str = iconv($data_charset, $send_charset, $str);
}
return '=?' . $send_charset . '?B?' . base64_encode($str) . '?=';
}
if (isset ($_POST['message'])) {
$name_from = @ trim ($_POST['name']);
$email_from = @ trim ($_POST['email']);
$psubject = @ trim ($_POST['subject']);
$message = @ trim ($_POST['message']);
$subject = "$psubject (отправитель: $name_from)";
$body = "Тема: $psubject \n\n $message \n\n Имя: $name_from \n\n Контакты: \n $email_from";
send_mime_mail(@ trim ($_POST['name']),
'robot@example.com',
'Поддержка',
'test@example.com',
'UTF-8', // кодировка, в которой находятся передаваемые строки
'KOI8-R', // кодировка, в которой будет отправлено письмо
$subject,
$body);
}
?>
$body = iconv('cp1252', 'KOI8-R', $body);
HTTP Request Header
Connect to 0.0.0.0 on port 80 ... ok
GET / HTTP/1.1[CRLF]
Host: example.com[CRLF]
Connection: close[CRLF]
User-Agent: Web-sniffer/1.0.44 (+http://web-sniffer.net/)[CRLF]
Accept-Encoding: gzip[CRLF]
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[CRLF]
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4[CRLF]
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF]
Cache-Control: no-cache[CRLF]
Referer: http://web-sniffer.net/
HTTP Response Header
Server: nginx
Date: Mon, 07 Jan 2013 11:24:49 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: close
X-Powered-By: PHP/5.3.13
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
Set-Cookie: PHPSESSID=5e8165d367447d3c58a0c1c95ed6ca95; path=/
Set-Cookie: language=ru; expires=Wed, 06-Feb-2013 11:24:49 GMT; path=/; domain=example.com
Set-Cookie: currency=RUB; expires=Wed, 06-Feb-2013 11:24:49 GMT; path=/; domain=example.com
X-Powered-By: PleskLin
Cache-Control: max-age=604800, public
Поэтому и ищем «программные» варианты.