[thelist] Double Emails with PHPmail

Rob Smith rob.smith at THERMON.com
Tue Jul 15 09:06:17 CDT 2003


Hi list,

I'm having a small problem with a self-developed PHP shopping cart system.
As of right now, it works great, but it's sending the notification emails
twice.

Once the order is ready, all required fields are filled, a correct email
address is provided, a PHP-e-mail is sent to me telling me a new order is
ready, and another email is sent to the customer telling them I'm working to
fill the order. Typical.

At best here's what the (psuedo)code looks like:

 if ($required_fields == "Yes" && $News == "") {
   mail($sender,$subject,$message,$headers);
   echo $sender . " " . $subject . " " . $message . " " . $headers .
"<br><br>";
    if ($Email == "Good") {
      mail($sender2,$subject2,$message2,$headers2);
      echo $sender2 . " " . $subject2 . " " . $message2 . " " . $headers2;
    }
  }

Output:
my at email.com Test. This is a test of the PHP-e-mail system. (some header
stuff)

myother at email.com Wow. I can see my house from hereeeeeee. (some more header
stuff)

Yet I receive the first email twice. The date/time sent are identical on
both emails as well as the second emails. From what I write here, it sounds
like I should see as output

Email 1

Email 2
Email 1

Email 2

...but I don't. Any ideas?

Rob.Smith


More information about the thelist mailing list