oops, i accidentally added an unwanted " in there...
if you wanna just post the variables in I have modified it to do that.
here is the code:
<?
$fp = fopen("./mailtemplate.txt","r");
while(!feof($fp)) {
$contents .= fread($fp,4096);
}
fclose($fp);
$contents = str_replace("__NAME__",$_REQUEST[name],$contents);
$contents = str_replace("__USERNAME__",$_REQUEST[username],$contents);
$contents = str_replace("__PASSWORD__",$_REQUSET[password],$contents);
mail($emailFromDB,"Forgot Password Details",$contents,
"From: [email]you@youraddress.com[/email]");
echo "Your login details have been emailed to $emailFromDB.";
?>
Just post data from a form with input names of name, username, and password and the script will make the appropriate replacements...
it is also good so you can just use query string:
send.php?name=John%20Doe&username=jdoe&password=abcdefg