<?php mail ("<?php include "e-mail.txt" ?>", "тест", "тест", "тест") ?> 

Writes an error in the third line. As I understand it, you can not do this, code:

 ..."<?php include "e-mail.txt" ?>"... 

Well, how then to extract the information from the file in such cases?

    2 answers 2

     $content = file_get_contents("e-mail.txt"); 

    And replace the dash with an underscore, - with _, the compiler can take it as a minus sign.

    • The minus sign in the file name will be accepted. With file_get_contents () agree. + in karma. - kemerov4anin
    • $content = file_get_contents("e-mail.txt"); mail ($content, "тест", "тест", "тест"); To do so ^ - kemerov4anin
    • kemerov4anin, so correct;) $content = file_get_contents("e-mail.txt"); mail ("$content", "тест", "тест", "тест"); $content = file_get_contents("e-mail.txt"); mail ("$content", "тест", "тест", "тест"); - nick777
    • And if you add something else, use single quotes so that the dash does not seem like a minus, like this: file_get_contents ('e-mail.txt'); for double operations may occur). - Andrei Arshinov
    • one
      I gave you a link to the description of string constants, but your statement is unfounded. Either provide prooflink, or the appropriate code. - Ilya Pirogov
     $fh = fopen("e-mail.txt", "r"); $data = fread($fh, filesize("e-mail.txt")); fclose($fn); mail ($data, "тест", "тест", "тест");