I'm totally clueless on this one -- I'm getting 3 copies of every Email (in
plain text, not HTML as expected), from a single mail() line... Can anyone
tell me what might be causing the duplicates??
Thanx!
Wm
<?PHP
include('dbconn.php');
$query="SELECT
artistID,active,email,firstname,lastname,city,stat e,mentor from artists
WHERE artistID='$artistID'";
$result=mysql_query($query) or die(mysql_error("Could not execute
query."));
while($row = mysql_fetch_array($result)) {
$email = $row['email'];
$notactive = $row['active'];
$firstname = $row['firstname'];
$lastname = $row['lastname'];
$city = $row['city'];
$state = $row['state'];
$mentor = $row['mentor'];
if ($mentor == "1") {
$class = "as a Mentor";
}
else {
$class = "as an Assistant";
}
if (($notactive == "0") AND ($ver == "1")) {
mysql_query("UPDATE artists SET active='1' WHERE artistID =
'$artistID' LIMIT 1");
echo "Your listing has been successfully activated -- welcome to
Makeup Mentors!<BR>
Please tell a friend about this resource!";
// generate Email
$headers = "From: domain.com <We*******@domain.com>\n";
$headers .= "X-Sender: <We*******@domain.com>\n";
$headers .= "X-Mailer: domain.com\n"; //mailer
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <We*******@domain.com>\n";
$headers .= "bcc: ma**@herdomain.com";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$city = stripslashes($city);
$message = "
<p align=\"left\">domain.com has just activated the following artist
$class:</p>
<p align=\"left\">Name: $firstname $lastname<br>
Location: $city, $state</p>
<p> </p>
<p align=\"left\">Webmaster<br>
<A HREF=\"http://www.domain.com\">www.domain.com</A></p>";
$subject = "Makeup Mentors listing verification";
$to = "wi*****@mydomain.net";
mail($to, $subject, $message, $headers);
}
else if (($active > 0) AND ($ver == "1")) {
echo "Your listing is already activated.<BR>";
}
}
?>