juggy ты сначало проверь потом говари эта функция не хрена не робит а может у меня чтото не настроено
1. форма с именем file.htm

PHP код:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="mail.php">
<input name="file" type="file" size="30"><br>
<input name="send" type="submit" value="send">
</form>
</body>
</html>
2. файл отправки писма mail.php

PHP код:
<?php
function xmail( $from, $to, $subj, $text, $filename) {
$f = fopen($filename,"rb");
$un = strtoupper(uniqid(time()));
$head = "From: $from\n";
$head .= "To: $to\n";
$head .= "Subject: $subj\n";
$head .= "X-Mailer: PHPMail Tool\n";
$head .= "Reply-To: $from\n";
$head .= "Mime-Version: 1.0\n";
$head .= "Content-Type:multipart/mixed;";
$head .= "boundary=\"----------".$un."\"\n\n";
$zag = "------------".$un."\nContent-Type:text/html;\n";
$zag .= "Content-Transfer-Encoding: 8bit\n\n$text\n\n";
$zag .= "------------".$un."\n";
$zag .= "Content-Type: application/octet-stream;";
$zag .= "name=\"".basename($filename)."\"\n";
$zag .= "Content-Transfer-Encoding:base64\n";
$zag .= "Content-Disposition:attachment;";
$zag .= "filename=\"".basename($filename)."\"\n\n";
$zag .= chunk_split(base64_encode(fread($f,filesize($filename))))."\n";
return @mail("$to", "$subj", $zag, $head);
}
xmail("opex@atnet.ru","opex@atnet.ru","File","text","$file");
?>
вот это все не робит выводятся ошибки плана
Цитата:
Warning: fopen(): Unable to access D:\\document\\Opex\\Programming\\Flash\\Samples\\3_использование curveTo\\1.zip in /www/virtual-servers/www.ttt.ru/design.ttt.ru/htdocs/test_php/mail.php on line 3
Warning: fopen(D:\\document\\Opex\\Programming\\Flash\\Samples\\3_использование curveTo\\1.zip): failed to open stream: No such file or directory in /www/virtual-servers/www.ttt.ru/design.ttt.ru/htdocs/test_php/mail.php on line 3
Warning: filesize(): Stat failed for D:\\document\\Opex\\Programming\\Flash\\Samples\\3_использование curveTo\\1.zip (errno=2 - No such file or directory) in /www/virtual-servers/www.ttt.ru/design.ttt.ru/htdocs/test_php/mail.php on line 21
Warning: fread(): supplied argument is not a valid stream resource in /www/virtual-servers/www.ttt.ru/design.ttt.ru/htdocs/test_php/mail.php on line 21
|
думал надо изминит прова вствляю
перед оброшением к функции
chmod("$file", 0777);
запускаю выводит ошибки тоеого плана
Цитата:
Warning: chmod(): Unable to access D:\\document\\Opex\\Programming\\Flash\\Samples\\3_использование curveTo\\1.zip in /www/virtual-servers/www.ttt.ru/design.ttt.ru/htdocs/test_php/mail.php on line 25
Warning: chmod(): No such file or directory in /www/virtual-servers/www.ttt.ru/design.ttt.ru/htdocs/test_php/mail.php on line 25
Warning: fopen(): Unable to access D:\\document\\Opex\\Programming\\Flash\\Samples\\3_использование curveTo\\1.zip in /www/virtual-servers/www.ttt.ru/design.ttt.ru/htdocs/test_php/mail.php on line 3
Warning: fopen(D:\\document\\Opex\\Programming\\Flash\\Samples\\3_использование curveTo\\1.zip): failed to open stream: No such file or directory in /www/virtual-servers/www.ttt.ru/design.ttt.ru/htdocs/test_php/mail.php on line 3
Warning: filesize(): Stat failed for D:\\document\\Opex\\Programming\\Flash\\Samples\\3_использование curveTo\\1.zip (errno=2 - No such file or directory) in /www/virtual-servers/www.ttt.ru/design.ttt.ru/htdocs/test_php/mail.php on line 21
Warning: fread(): supplied argument is not a valid stream resource in /www/virtual-servers/www.ttt.ru/design.ttt.ru/htdocs/test_php/mail.php on line 21
|
и с кокой стороны работает эта функция(ну может я конешно чтото не правелно делаю если это так то обясните что буду очень презнателен)