I am trying to pull a txt file into this purser so that it will add
the data to the variables. Now the code below works if I just add an
echo $message inside the while loop. But this is not what I want to
do. I what it to run the while loop and after it is done pass the
whole message to the mail program. I am trying to make this so a end
user can customize the e-mail message to say what they want it to
say. Without having to go into the code and mess with it. Also how can
I add empty lines in the txt message so that it will space the message
properly rather than have it bunch it all together
$fullname="Full Name";
$email="[EMAIL PROTECTED]"; pursing a text file
$hostdomain="domain.com";
$hostname="www";
$domain="test";
$tld=".com";
$baseip="234.444.44.444";
$username="rkurth";
$password="boat";
$userdatabase="testdata";
$newuser="test1";
$newuserpass="test1";
$sales="sales";
$fp=fopen("mail.txt","r");
while(!feof($fp))
{
$buffer=fgets($fp,"1000");
eval( "\$buffer = \"$buffer\";" );
$message = $buffer;
echo $message; <it will work if I add this echo but this is
not what I want to do.
}
fclose($fp);
/* recipients */
$recipient = " $fullname <$email>";
//header
$headers ="From: Sales Department <$sales@$hostdomain>";
//subject
$subject =$sub;
/* message*/
/* and now mail it */
mail($recipient, $subject, $message, $headers);
//print "$recipient, $subject, $message, $headers";
This is what mail.txt looks like
Dear $fullname,
Your webhosting account has been created. Please use the following data to log in:
Domain: $hostname.$domain$tld
IP-Address: $baseip
Username: $username
Password: $password
\n\n
Mysql Database: $userdatabase
Mysql Username: $newuser
Mysql Password: $newuserpass
Thanks for choosing $hostdomain!
Best regards,
Richard
mailto:[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]