Why gives an error?
Warning: filesize () [function.filesize]: stat failed for /php/book/mail/index.php in C: \ OpenServer \ domains \ localhost \ php \ book \ mail \ index.php on line 14
Email successfully sent
<?php $headers = "Content-Type: text/html; charset=KOI-R\r\n"; $headers .= "From: server <someone@somewhere.ru>\r\n\r\n"; ?> <?php $theme = 'Отчёт с сайта'; $theme = convert_cyr_string($theme, 'w', 'k'); $message = "<html> <head></head> <body> Письмо отправлено - ".date("dmY H:i:s")."<br> Размер скрипта отправителя - ".filesize($_SERVER['PHP_SELF'])." </body> </html>"; $message = convert_cyr_string($message, 'w', 'k'); $headers = "Content-Type: text/html; charset=KOI-R\r\n"; if(mail($to, $subject, $message, $eaders)){ echo "Письмо успешно отправлено"; } else{ echo "Произошла ошибка - письмо не отправлено"; } ?> I do the book Tutorial PHP5 / 6
$_SERVER['PHP_SELF']use__FILE__- Rochfort