html i mail
jeg har dette script:<?php
function check_php_version($version)
{
global $adminEmailAddr;
// intval used for version like "4.0.4pl1"
$testVer=intval(str_replace(".", "",$version));
$curVer=intval(str_replace(".", "",phpversion()));
if( $curVer < $testVer )
return false;
return true;
}
// Users are stored in a string
$users = "";
$subject = $_POST["SUBJECT"];
$body = $_POST["BODY"];
// Get all the users.
$link = OpenConnection();
$query = "select username, email from $dbaseUserData";
$result = mysql_query($query)
or die("Unable to perform query: $query");
// Only versions of PHP over 4.3 support BCC.
if (check_php_version('4.3')) {
while ($line = mysql_fetch_array($result)) {
$users = $line["email"].", $users";
}
// Send the email
if (@mail($adminEmailAddr,$subject,$body,
"From: $adminEmailAddr\r\n"
."Reply-To: $adminEmailAddr\r\n"
."Bcc: $users") == FALSE) {
LogMsg("Unable to send BCC email from $adminEmailAddr, to $users subject: $subject<br>$body");
}
} else {
// Send as individual emails.
while ($line = mysql_fetch_array($result)) {
$user = $line["email"];
if (FALSE == @mail($user,$subject,$body,
"From: $adminEmailAddr\r\n"
."Reply-To: $adminEmailAddr\r\n")) {
LogMsg("Unable to send email to single user from $adminEmailAddr, to $user subject: $subject<br>$body");
}
}
}
CloseConnection($link);
forward("PredictionIndex.php");
?>
hvordan skriver jeg det så man kan sende html i mails ?
