<?php
function addmail($usermail, $subject, $msg, $mail="", $name="") {
$subject = utf_to_win($subject);
$msg = utf_to_win($msg);
$name = utf_to_win($name);
$subject = convert_cyr_string($subject, 'w','k');
$msg = convert_cyr_string($msg, 'w','k');
$name = convert_cyr_string($name, 'w','k');
$subject = '=?KOI8-R?B?'.base64_encode($subject).'?=';
$adds = "From: ".$name." <".$mail.">\n";
$adds .= "X-sender: ".$name." <".$mail.">\n";
$adds .= "Content-Type: text/plain; charset=koi8-r\n";
$adds .= "MIME-Version: 1.0\n";
$adds .= "Content-Transfer-Encoding: 8bit\n";
$adds .= "X-Mailer: PHP v.".phpversion();
return mail($usermail,$subject,$msg,$adds);
?>
что-то типо вроде, но неработает