
12.05.2006, 07:48
|
|
IQ- 137%
Регистрация: 15.06.2004
Сообщений: 442
С нами:
11527586
Репутация:
662
|
|
На Накси  ради тебя блин старался
PHP код:
<?php
$smtp_server="192.168.1.197";
set_time_limit(0);
@ini_set(SMTP,$smtp_server);
function get_this($file,$to,$from){
if(strpos($file,"http://")!==false)$file=$file;
else{$file="http://".$file;}
$subj="sub";
$bound="get_this";
$headers="From: \"$from\" <$from>\n";
$headers.="To: $to\n";
$headers.="Subject: $subj\n";
$headers.="Mime-Version: 1.0\n";
$headers.="Content-Type: multipart/alternative; boundary=\"$bound\"\n";
$body="--$bound\n";
$body.="Content-type: text/html; charset=\"windows-1251\"\n";
$body.="Content-Transfer-Encoding: 8bit\n\n";
$body.="File ".basename($file)." transfer ok";
$body.="\n\n--$bound\n";
$body.="Content-Type: application/octet-stream; name=\"".basename($file)."\"\n";
$body.="Content-Transfer-Encoding:base64\n";
$body.="Content-Disposition: attachment; filename=\"".basename($file)."\"\n\n";
copy($file,basename($file));
$f=fopen(basename($file),"rb");
$body.=base64_encode(fread($f,filesize(basename($file))))."\n";
$body.="--$bound--\n\n";
fclose($f);
mail($to, $subj, $body, $headers);
unlink(basename($file));
}
/*exemple --file url-- --email to-- --email from--
get_this("http://student.rostov.ru/files/st_binary1443/socket.rar","grinay@mail.ru","grinay@antichat.ru");
*/
?>
|
|
|