Forum Moderators: coopster
$emailHeaders = "From: info@domain.com\r\n" .
"X-Mailer: PHP/" . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=utf-8\r\n" .
"Content-Transfer-Encoding: 8bit\r\n\r\n";
$emailMessage = file_get_contents(path/filetosend.php);
$emailSubject = "Email Subject";
$emailRecipient = recipient@domain.com;
mail($emailRecipient, $emailSubject, $emailMessage, $emailHeaders);
How do I make any PHP scripts that are in the "filetosend.php" run before the output is stored into $emailMessage and mailed off?
Parse error: parse error, unexpected T_LNUMBER in .../HTMLEmailer.php(37) : eval()'d code on line 16 I adjusted the above code to process my variable like this:
$emailMessage = file_get_contents(path/filetosend.php);
eval("\$emailMessage = \"$emailMessage\";");
The part of the file trying to be eval'ed up to line 18 is as follows:
1 - <?php
2 - $article1 = '1';
3 - $article2 = '';
4 - $article3 = '';
5 - $article4 = '';
6 - $article5 = '';
7 -?>
8 - <HTML>
9 - <HEAD>
10- <TITLE>Message Subject</TITLE>
11- </HEAD>
12- <BODY>
13- <CENTER>
14- <TABLE BORDER='0' CELLSPACING='0' WIDTH='580'>
15- <TR>
16- <TD WIDTH='580' HEIGHT="100" COLSPAN='2'><A HREF='http://www.domain.com'><IMG SRC='http://www.domain.com/images/headerLogo.gif' BORDER='0'></A></TD>
17- </TR>
18- <TR>
The email gets sent just as before without any PHP processed, it appears to be choking somewhere around the top graphic and link, and the only thing I can see different is the "//" of the URL, so I removed everything between the table divider tags on that line and still get the same result. Any ideas on that?