[php:1:a5d8580583]<?php
function my_mail2($mail_parts){
$mail_from=$mail_parts["mail_from"];
$mail_reply_to=$mail_parts["mail_reply_to"];
$mail_subject=$mail_parts["mail_subject"];
$mail_body=$mail_parts["mail_body"];
$mail_type=$mail_parts["mail_type"];
$userfile=$mail_parts["userfile"];
$userfile_type=$mail_parts["userfile_type"];
$userfile_name=$mail_parts["userfile_name"];
$userfile_size=$mail_parts["userfile_size"];
if(empty($mail_subject)) error("Brak tematu!");
if(empty($mail_body)) error("Brak treści!");
$mail_headers = '';
if(!empty($mail_from)) $mail_headers .= "From: $mail_fromn";
if(!empty($mail_reply_to)) $mail_headers .= "Reply-to: $mail_reply_ton";
$pyt=mysql_query("SELECT usremail FROM user");
while($b=mysql_fetch_row($pyt)){
$adresy[]=$b[0];
}
$adresy=implode(",", $adresy);
if(!empty($adresy)) $mail_headers .= "Bcc: $adresy" . "n";
$mail_subject = stripslashes($mail_subject);
$mail_body = stripslashes($mail_body);
if($userfile_size > 0)
{
$mail_boundary= md5(uniqid(time()));
$mail_headers .= "MIME- Version: 1.0rn";
$mail_headers .= "Content-type: multipart/mixed;
boundary="$mail_boundary"rnrn";
$mail_headers .= "This is a multi-part message in MIME format.rnrn";
$fp = fopen($userfile, "r");
$file= fread($fp, filesize($userfile));
$file= chunk_split(base64_encode($file));
$new_mail_body = "--$mail_boundaryrn";
$new_mail_body .= "Content-type:text/plain;charset=iso-8859-2rn";
$new_mail_body .= "Content-transfer-encoding:8bitrnrn";
$new_mail_body .= "$mail_bodyrn";
$new_mail_body .= "--$mail_boundaryrn";
if(!empty($userfile_type)) $mime_type=$userfile_type;
else $mime_type = "application/ocet-stream";
$new_mail_body .= "Content-type:$mime_type;name=$userfile_namern";
$new_mail_body .= "Content-transfer-encoding:base64rnrn";
$new_mail_body .= $file . "rnrn";
$new_mail_body .= "--$mail_boundary--";
$mail_body = $new_mail_body;
}
else if($mail_type == 'html')
{
$mail_headers .= "Content-type:text/html; charset=iso-8859-2rn";
$mail_headers .= "Content-transfer-encoding:8bitrnrn";
}
else
{
$mail_headers .= "Content-type:text/plain; charset=iso-8859-2rn";
$mail_headers .= "Content-transfer-encoding:8bitrnrn";
}
mail($mail_from, $mail_subject,$mail_body,$mail_headers);
}
?>[/php:1:a5d8580583]
No i nie wysyła mi ukrytych maili mimo iż adresy są podane w zmiennej $adresy. czy widać błąd?