Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Receiving multiple create account emails


scottiegirl

Recommended Posts

Greetings all!

 

I am testing all aspects of my catalog/shopping cart before rolling it out to the public ( :rolleyes: anal, I know) and have found that I am receiving 2 emails when I create an account. I believe the problem is in the create_account.php file right about here:

 

// build the message content
     $name = $firstname . ' ' . $lastname;

     if (ACCOUNT_GENDER == 'true') {
        if ($gender == 'm') {
          $email_text = sprintf(EMAIL_GREET_MR, $lastname);
        } else {
          $email_text = sprintf(EMAIL_GREET_MS, $lastname);
        }
     } else {
       $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
     }

     $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_CLOSING . EMAIL_WARNING;
     tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

     tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));

 

Please note that I didn't alter any original coding, just added EMAIL_CLOSING (custom-defined in includes/languages/english/create_account.php) to the $email_text variable.

 

When I look at the headers of the emails I receive, the "to" includes both the plain email address AND the customer name with the email address in parens, ergo the reason for 2 emails, but I don't see where that's "programmed" in the above. Maybe I'm just looking at the wrong section of coding. Can anyone help???

 

Thanks much!

~~~~~~~~~~~~~~~~~~~~~~

scottiegirl

 

"You can't! It's impossible! I'm far too busy, so ask me now before I can become sane." - Edna "E" Mode

Link to comment
Share on other sites

That bit of code is just generating part of the email not actually emailing it, check for more references of tep_mail in that file.

Kenneth S

--------------

Customer "Are you a real programmer?"

Me "No, but I did stay at a Holiday Inn Express last night"

Link to comment
Share on other sites

There is no other instance of tep_mail in the file. OOPS! Silly me. The includes/functions/general.php file has the email protocols in it:

 

//! Send email (text/html) using MIME
// This is the central mail function. The SMTP Server should be configured
// correct in php.ini
// Parameters:
// $to_name           The name of the recipient, e.g. "Jan Wildeboer"
// $to_email_address  The eMail address of the recipient,
//                    e.g. [email protected]
// $email_subject     The subject of the eMail
// $email_text        The text of the eMail, may contain HTML entities
// $from_email_name   The name of the sender, e.g. Shop Administration
// $from_email_adress The eMail address of the sender,
//                    e.g. [email protected]

 function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) {
   if (SEND_EMAILS != 'true') return false;

   // Instantiate a new mail object
   $message = new email(array('X-Mailer: osCommerce Mailer'));

   // Build the text version
   $text = strip_tags($email_text);
   if (EMAIL_USE_HTML == 'true') {
     $message->add_html($email_text, $text);
   } else {
     $message->add_text($text);
   }

   // Send message
   $message->build_message();
   $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
 }

 

I don't see any place where the email address would be duplicated. I also just found out that other emails (like test emails sent from the admin panel and order confirmation emails) are coming in twice as well.

 

Suggestions?

~~~~~~~~~~~~~~~~~~~~~~

scottiegirl

 

"You can't! It's impossible! I'm far too busy, so ask me now before I can become sane." - Edna "E" Mode

Link to comment
Share on other sites

Make sure in every instance tep_mail is called that it's not duplicated in the file. As in if it calls tep_mail twice, it will send 2 emails. That code you have is correct as far as I can see.

Kenneth S

--------------

Customer "Are you a real programmer?"

Me "No, but I did stay at a Holiday Inn Express last night"

Link to comment
Share on other sites

  • 4 weeks later...

i am having the SAME exact problem...receiving duplicate emails in every aspect of emailing, as customer opening new acct, customer whose order is being processed, and as store owner.

 

can someone please tell me SPECIFICALLY which file(s) to open and modify so that i only send AND receive one email each time? (i'm not 'getting' the 'TEP_EMAIL' instructions!)

 

let me know if you need more details or my code!

 

thanks!

andrea

Link to comment
Share on other sites

  • 5 months later...
i am having the SAME exact problem...receiving duplicate emails in every aspect of emailing, as customer opening new acct, customer whose order is being processed, and as store owner.

 

can someone please tell me SPECIFICALLY which file(s) to open and modify so that i only send AND receive one email each time? (i'm not 'getting' the 'TEP_EMAIL' instructions!)

 

let me know if you need more details or my code!

 

thanks!

andrea

I had this EXACT same problem. Simple fix - make sure that you have your e-mail set to sendmail and not SMTP in Admin >> Config >> E-mail Options >> E-mail Transport Method.
Link to comment
Share on other sites

  • 2 months later...

Archived

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

×
×
  • Create New...