mail() creating duplicates
Posted: Tue Jun 13, 2006 3:00 pm
Being no stranger to php or the good old mail() function, I feel... betrayed by it. Oh, it works well enough in a new application - too well, you might say. No matter what I seem to try, I get duplicates of each and every message.
I have tried removing the HTML tags (and appropriate headers), but still, the duplicates persist.
Since I essentially cut and pasted this code out of another workig site, I am stumpted as to why it doesn't work. Ideas?
Thanks,
Olan
I have tried removing the HTML tags (and appropriate headers), but still, the duplicates persist.
Code: Select all
$destination_email=$_POST['email'.$x];
$mail_subject="My Stress Tolerance is ".$_POST['stress']."%! What's Yours, ".$_POST['fname'.$x]."?";
$fromheader = "From: ".$_POST['username']." <stresstest@ratanjit.com>\r\n X-Mailer: PHP/" . phpversion()."\r\n";
$fromheader.="MIME-Version 1.0 \r\n";
$fromheader.="Content-Type: text/html; charset=ISO-8859-1 \r\n";
$emailbody="<html><body>\r\n";
$emailbody.="I recently took a Stress Test from Stress-Free Expert Ratanjit online and my Stress Tolerance is ".$_POST['stress']."%.\n\r
";
$emailbody.="We all know that stress is all around us, ".$_POST['fname'.$x].", but do you know just how much it really affects you?\n\r
";
$emailbody.="Take Ratanjit's FREE Stress Test online to find out. All you have to do is visit <a href = \"http://www.stresstest.ratanjit.com\">stressstest.ratanjit.com</a> and answer 10 multiple choice questions. Ratanjit will even make personalized recommendations based on your results so you too can live Stress-Free! And best of all, it's totally FREE!\n\r
";
$emailbody.="What's your score, ".$_POST['fname'.$x]."? Can you beat my Stress Tolerance? Go to <a href = \"http://www.stresstest.ratanjit.com\">stressstest.ratanjit.com</a> to find out!";
$emailbody.="</body></html>\r\n";
mail($destination_email, $mail_subject, $emailbody, $fromheader);Thanks,
Olan