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

  • try instead of $_SERVER['PHP_SELF'] use __FILE__ - Rochfort
  • Thanks helped, but where did it go? - DivMan
  • one
    Here is the documentation for the mail function, everything is written there. - Rochfort

0