Тема: PHP e-mail spamer
Показать сообщение отдельно

  #7  
Старый 31.08.2006, 21:48
gemaglabin
Banned
Регистрация: 01.08.2006
Сообщений: 725
Провел на форуме:
7681825

Репутация: 4451


По умолчанию

Смотри,допустим ты передаешь имя файла через POST

PHP код:
if isset($_POST['file'])
{
 
$pathtofile $_POST['file'];
 
$mfile fopen($pathtofile,"r");
 if (!
$mfile) die ("file $pathtofile cannot be open);
 
$file = fread($mfile,filesize($pathtofile);
 fclose(
$mfile);
 
$bound  = "--".md5(uniqid(time()));
 
$bound .= "MIME-VERSION": 1.0\n";
 
$headr  .= "Content-Type: multipart/mixed; boundary=\"$bound\"\n";
 
$multip  .= "--$bound\n\";
 
$multip  .= "Content-Typetext/htmlcharset:  koi8-r\n";
 
$multip  .= "Content_transfer-EncodingQuot-Printed\n\n\";
 
$multip  .= "it is my message\n\n";
 
$msg      = "Content-Typeaplication/octet-stream";
 
$msg     .= "file name= \"$pathtofile\"\n";
 
$msg     .= "Content-Transfer-Encoding: base64\n";
 
$msg     .= "Content_disposotion: attachement; filename = \"".$pathtofile."\"\n\n";
 
$msg     .=  chunk_split(base64_encode($file))."\n";
 
$multip  .= "--$bound\n".$msg."--$bound--\n";
 if (
mail("ge@ma.ru","subject",$multip,$headr)) echo "sent";

 
Ответить с цитированием