Hi,
I'm sending an email where the body of the email is retrieved from a text file template. Tags in the content are replaced with information submitted by a user.
When using this script on an NT OS the formatting of the text template is fine and the whole thing works great, but on LINUX the email body is all contained on one long line. The relevant section of code is included below.
If anyone has any suggestions I would be most grateful.
Many Thanks, James
// #################
// Open the email template
$file = fopen($newuser_template, "r") or print "could not open email template";
// read the file contents
$message = fread($file, filesize($newuser_template));
// Close the file
fclose($file);
// Replace the tags in the template with the users details
while (list($key, $val) = each($HTTP_POST_VARS)) {
$message = str_replace("<!--$key-->",$val,$message);
}
// Replace other relevant information
$message = str_replace("<!--password-->",$password,$message);
$message = str_replace("<!--date-->",date("h:i A l F dS, Y"),$message);
// Send the email
$to = $blwy_email . ", $email";
$subject = $newuser_subject;
mail($to, $subject, $message);