<?php
$att = "M
Модель Сер.№ Статус Комментарии
M A Ремонт не принят
M A Ремонт не принят
M Отчет принят.
Модель Сер.№ Статус Комментарии
M A Ремонт не принят Ошибка
M A Ремонт не принят
";
$ob = "----=_OuterBoundary_000";
$ib = "----=_InnerBoundary_001";
$headers = "MIME-Version: 1.0\n";
$headers .= "From: [email][email protected][/email]\n";
$headers .= "To: [email][email protected][/email]\n";
$headers .= "Content-Type: multipart/mixed;\nboundary:\"".$ob."\"\n";
$msg = "This is a multi-part message in MIME format.\n";
$msg .= "\n--".$ob."\n";
$msg .= "Content-Type: multipart/alternative;\nboundary:\"".$ib."\"\n\n";
$msg .= "\n--".$ib."\n";
$msg .= "Content-Type: text/plain;\ncharset=\"windows-1251\"\n";
$msg .= "Content-Transfer-Encoding: quoted-printable\n\n";
$msg .= "Попытка\n\n";
$msg .= "\n--".$ib."--\n";
$msg .= "\n--".$ob."\n";
$msg .= "Content-Type: text/plain;\nname=\"test.txt\"\n";
$msg .= "Content-Transfer-Encoding: base64\n";
$msg .= "Content-Disposition: attachment;\nfilename=\"test.txt\"\n\n";
$att = chunk_split(base64_encode($att));
$msg .= "$att\n\n";
mail ('[email protected]', 'Test', $msg, $headers);
?>