Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

no account confirmation email?


Recommended Posts

ok when i register an account on my store, I get no account confirmation email


(just testing before i let other people use it)


whats the deal? everything else is working fine


what do i need to do to fix this?



adam mccombs

Link to comment
Share on other sites

i don't think i explained this well enough....


when you register a new acount as a customer you should get a confirmation email - correct?


thats not happening right now.


what do i have to do to get this to work?

Link to comment
Share on other sites



In 'create_account.php', the function that does the email is called tep_mail() , and it is the osC function that is used in many places to send email. In the file I mentioned, the function tep_mail() is at line 246 , but is only executed if there are no errors with creating the account. If you are sure the account is being created successfully, you would be wise to see what is being passed to the tep_mail() function, so before line 246, add the following:


echo $name;
echo $email_address;
echo $email_text;


then create a new account, and see what is displayed (echoed). If the values seem correct, then you will need to dig deeper.


The function tep_mail() is defined at line 959 of /includes/functions/general.php


Notice that tep_mail() expects 6 parametrs to be passed, the same number as echoed above. The first thing tep_mail() checks is to see if you have set "SEND_EMAILS" to true, in the admin functions. If you haven't, you can forget about any emails being sent. If you have, then follow the code down.


The function tep_mail() itself is quite small, as you can see, however it calls 2 other functions, the first is to build the message, and the second is to send the message (which actually calls the PHP mail() function.


The build_message() function is at line 321 of /includes/classes/email.php


The send() function is at line 473 of /includes/classes/email.php


By now, you may be getting too bogged down in the osC code. :D


Therefore, as I don't know if ANY email works for you, please try the following small PHP script. because in the end, the last function that is called is the PHP function called mail(), therefore, you may need to test that in isolation.



mail('[email protected]', 'Test', 'Is this working?', "From: [email protected]\nMIME-Version: 1.0");



Link to comment
Share on other sites

  • 4 weeks later...

I'm having a simlar problem. My hosting comany is using Linux and I am running the latest version of OSCommerce.


I receive order confirmation emails as well as the extra emails that are sent to the owner etc. I am not receiving emails when the account is created nor when the order status is updated or a comment is added. And in those cases, yes I have the checkbox checked that indicates that the customer should be notified etc. I also do not receive an email when the admin goes into the send email feature under tools.


One extra piece of info that may help. Until recently the only emails being sent out were the extra order emails. The customer did not receive a confirmation. To fix that I changed my email settings from sendmail to SMTP. I realize that SMTP is only recommended for windows servers but I tried it and it allowed the customer to receive the order confirmation email.


I added the echo statements like you recommended and everything appeared to work fine. I also looked at the tep_mail function and it looks fine. The fact that some emails and getting out and others are not is pretty weird.


Any ideas?

Link to comment
Share on other sites



I have seen a number of people state that they have problems with emails, in general, inconsistancies. TRy This:








Also, I'm not entirely convinced that the tep_mail() function is the only osC code that sends emails. I say that because I need to change the whole method in which emails are sent and use another PHP email function to send emails.


When I was trying to look at emails and osC, I used a small piece of code to call the PHP mail() function, because if you follow tep_mail() through to the 'sending', that is all it does anyway.


So, do some small isolated testing on using the PHP mail() function, to make sure there are no issues with the hosting company you use or their nail server setup,etc.



Link to comment
Share on other sites

As it turns out my hosting company does have a policy (read setting) that 'nobody' is not allowed to send emails out to email addresses that are not part of the domain. They were unwilling to change it. I understand why. But I was unwilling to change hosts so what I did is append a bogus email address to the to: field of every email sent by my site. This bogus email address is for my domain. I realize that is a very ugly hack but it has completely fixed the problem for me.


For those that are interested there are only two files that you need to modify to do this. They are:

1) includes/classes/email.php

2) admin/includes/classes/email.php


Just find the section where the code formats the to: field.

Link to comment
Share on other sites


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

  • Create New...