Hey all, Heres my problem, I have this written in "email.fff" ############# Start file ########## Hi $firstname $lastname, We have recieved your request for support.
We will get back to you shortly. Regards, $sitename
P.S below is the message you submitted: $message ############# End file ##########
Question is: How can I get the file in my php script and fill in those variables then send the above email message. I know how to open a file via fread/file I now how to do the mail() etc... Just a little confused....
Thanks, Ryan
well, seen as you've put it in a separate file, we'll need to eval it. So, let's go.
I'm assuming $sitename and $message are already set with the correct values before the script I'm going to show you starts:
<?php
// assume PHP 4.3.0+, otherwise use eg. $c = implode("\n", file('email.fff'));
$c = file_get_contents('email.fff');
eval('$emailMsg = "'.$c.'";');
// user@xxxxxxxxxxx can be replaced with eg $emailAddress if you've defined it earlier on.
mail('user@xxxxxxxxxxx', 'Re: support request', $emailMsg);
?>
hope that helps :) - Tul
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php