You can't use include like that. It returns a boolean not the file contents... the file contents is evaluated and sent to the browser. Here is one way you could use include().
PHP Code:
$flush;
$show = 'some string';
ob_start();
include('data.txt');
$message = ob_get_clean();
$to = "acsdaily@yahoo.com";
$subject = "Test";
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($to, $subject, $message, $headers);
Another:
PHP Code:
$show = 'some string';
$message = file_get_contents('data.txt');
$message = str_replace('<?php $show ?>', $show, $message);
$to = "acsdaily@yahoo.com";
$subject = "Test";
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($to, $subject, $message, $headers);
Another:
PHP Code:
$show = 'some string';
$message = file_get_contents('data.txt');
$message = eval($message);
$to = "acsdaily@yahoo.com";
$subject = "Test";
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($to, $subject, $message, $headers);
None of those are ideal though. A better way would be to modify the text file:
Text file
PHP Code:
$message = '<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
stuff Here. '.$show.'.
</body>
</html>';
Script
PHP Code:
$show = 'some string';
require('text.file')
$to = "acsdaily@yahoo.com";
$subject = "Test";
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($to, $subject, $message, $headers);
Bookmarks