Подскажите как мне отправить текстовый файл что бы товары из массива были на разных строках, а то у меня все в одну строку, вот мой код
$filename = "form.txt";
$to = "ooo@yandex.ru";
$from = "ooo@yandex.ru";
$subject = "zakaz";
$message = "zakaz";
$boundary = "---";
$headers = "From: $from\nReply-To: $from\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"";
$body = "--$boundary\n";
$body .= "Content-type: text/html; charset='utf-8'\n";
$body .= "Content-Transfer-Encoding: quoted-printablenn";
$body .= "Content-Disposition: attachment; filename==?utf-8?B?".base64_encode($filename)."?=\n\n";
$body .= $message."\n";
$body .= "--$boundary\n";
$cart_id = $this->model->getCartId();
$db=dbq::getInstance();
$result = "SELECT f.product_id,f.count,f.price,f.id,t.name FROM fsm_cart_product1 f
join tab t on t.id=f.product_id where f.cart_id='".$cart_id."' and f.cat='1'";
$snm=$db->query($result);
$text='';
while($myrow=$snm->fetch(PDO::FETCH_ASSOC)){
$text.=$myrow['name'].'\n';
}
$body .= "Content-Type: application/octet-stream; name==?utf-8?B?".base64_encode($filename)."?=\n";
$body .= "Content-Transfer-Encoding: base64\n";
$body .= "Content-Disposition: attachment; filename==?utf-8?B?".base64_encode($filename)."?=\n\n";
$body .= chunk_split(base64_encode($text))."\r\n";
$body .= "--".$boundary ."--\n";
mail($to, $subject, $body, $headers);
_____________
Womans in your town