Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multiple emails sent


panhd

Recommended Posts

Posted

Hello all,

 

I am having a weird problem. When ever I send email, be it from a completed order or I use the tools in admin, there are always two emails sent. If an order was placed, I recieve two identical emails. If a new customer signs up then he gets two identical welcome emails. If you place an order then you get get two identical order invoices... you get the point I think... where can I start to look for this problem.

 

thanks

Posted

Hi,

 

Try this test email script:

 

<?php

// some local variables
$from_name = "Chris";
$from_email = "[email protected]";
$to_name = "Chris";
$to_email = "[email protected]";
$subject = "Will I get 2 emails ??";

// headers need to be in the correct order...
$headers = "From: $from_name<$from_email>\n";
$headers .= "Reply-To: <$from_email>\n";

//message part
$message = "Here is my test email";

// send the message :-)
mail("$to_name<$to_email>", $subject, $message, $headers);

?>

 

If you get 2 copies, follow it up with your web hosts.

 

Peter

Posted

very cool Peterr... I know this is basic stuff but I dont use php to often and a refresher is always nice... I ran that script and it sends just one email.... I will try searching the files for the "mail" command and see if I can figure out why its being told to send it twice...thanks..any other tips are appreciated....

 

chris

Posted

Hi,

 

From PHPXref, the function tep_mail() is how osCommerce sends most (but not all apparently) emails:

 

Function and Method Cross Reference

 

tep_mail()

 

Defined at:

 

    * /admin/includes/functions/general.php -> line 1069

    * /includes/functions/general.php -> line 959

 

Referenced 10 times:

 

    * /checkout_process.php -> line 258

    * /checkout_process.php -> line 262

    * /contact_us.php -> line 24

    * /create_account.php -> line 246

    * /password_forgotten.php -> line 29

    * /tell_a_friend.php -> line 80

    * /includes/modules/payment/cc.php -> line 172

    * /includes/functions/general.php -> line 959

    * /admin/orders.php -> line 52

    * /admin/includes/functions/general.php -> line 1069

 

Peter

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...