Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fail to send email to customer


Guest

Recommended Posts

Hi, MEMBER,

 

I try to send email via TOOLSSend Email in admin to my customer. He said he hasn't receive my email at all. His email is correct.

 

Then, when I try to shopping using Bank Transfer Method to checkout, I also haven't receive the sales confirmation email. Why? This also happen when I send email via "Tell a friend", it also doesn't work.

 

Is there any configurations I set it wrongly or miss out? Please help me. Shortly, what problem that I face is can't send email out to anyone via my website.

 

Anyone, please help me. Thanks.

Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

in your admin panel goto Configuration>>E-Mail Options and check that your settings are correct

 

you can also goto your Tools>>Server Info to check if you have a smtp server installed or not

 

in email options check to make sure Send E-Mails is set to true

and Use MIME HTML when sending Emails is set to false

Verify Email address through DNS set to false

 

you can always change them later and play with those once you know your server is sending emails

Link to comment
Share on other sites

I try to set my email in "Send Extra Order Emails To" section, the order email can only send to me and not to my customer. This one also same in contact us page, I only can send email to my own domain email and not other email address like yahoo.com etc. Why this happen?

Link to comment
Share on other sites

I ask my hosting company about this issue. They said should used SMTP Authenticaiton to send email to third party. I really don't know how to set it in osCommerce. Should anybody know how to do it? Anybody help me at this point?

Link to comment
Share on other sites

PHP's mail function does not support SMTP authentication. The simplest thing to do would be to get the host to enable sendmail sending on the box and use that. http://us2.php.net/manual/en/function.mail.php is the explanation of how PHP's mail function works.

 

Good luck,

Matt

I love deadlines. I like the whooshing sound they make as they fly by. ---Douglas Adams

Link to comment
Share on other sites

I found one contribution from here about smtp authentication. It comes with "class.smtp.inc" file. When I execute by purchasing item, it come out error:

 

Fatal error: Cannot redeclare class smtp in /home/manyjewe/public_html/catalog/includes/classes/class.smtp.inc on line 12

 

Why this happen or what error is it? The contribution is as below:

 

http://www.oscommerce.com/community/contributions,901

Link to comment
Share on other sites

I've been fiddling with the same contribution. I solved it by changing email.php around line 499, where it reads "include('/.../includes/classes/class.smtp.inc');". I changed the "include" to "include_once" and the error was gone.

 

Hth, Henk

Link to comment
Share on other sites

Hi hlubbers,

 

After I change the "include" to "include_once", the errors gone. But, customer or third party still cannot receive email. Your site can run correctly?

 

The data that I key in "SMTP" section in "Email.php":

$params['host'] = 'mail.domainname.com';      // The smtp server host/ip

$params['port'] = 25; 	 // The smtp server port

$params['helo'] = 'domainname.com';	// What to use when sending the helo command. Typically, your domain/hostname

$params['auth'] = TRUE;  // Whether to use basic authentication or not

$params['user'] = '[email protected]';         // Username for authentication

$params['pass'] = 'xxxxxx';

 

Are above data that I key in correct? Please help me. Thanks.

Link to comment
Share on other sites

  • 3 weeks later...

The username would probably be info or info/mail.domainname.com, not [email protected]. Also, check with your smtp server administrator to make sure that you are using the correct username and password, etc. These are *their* settings, which they assign. Note: the username does not need to be specific to that email address. You might have multiple email addresses that all use the same user name.

 

You might find it easier to ask your host the Outlook Express 6 settings (they will work with this more often), which are as follows (before = is in $params above and after = is what it is called in Outlook Express 6):

 

  • host = Outgoing Mail (SMTP) under Server Information on Servers tab

[*]port = Outgoing Mail (SMTP) under Server Port Numbers on the Advanced tab

[*]helo = part of the email address after the @ sign or try the host above

[*]user = Account Name if you click the Settings tab under Outgoing Mail Server on the servers tab; this is usually the same as the Account Name under Incoming Mail Server on the servers tab (but does not have to be)

[*]pass = Password, which is in the same places as the Account Name

[*]email address = E-mail Address under User Information under the General Tab

Good luck,

Matt

Link to comment
Share on other sites

  • 2 weeks later...

I was having the problem of not receiving or sending e-mail with the contribution. I started to look at my mail server's logs and noticed that the email.php file was sending some interesting "junk" that was causing the mail not to send.

 

The problem was with the following code:

 

// begin     

      

                  include(DIR_WS_INCLUDES . '/classes/class.smtp.inc');



     $params['host'] = '';    // The smtp server host/ip

$params['port'] = 25;      // The smtp server port

$params['helo'] = ''; 	 // What to use when sending the helo command. Typically, your domain/hostname

$params['auth'] = TRUE;      // Whether to use basic authentication or not

$params['user'] = '';    // Username for authentication

$params['pass'] = '';    // Password for authentication



$send_params['recipients']	= array("$to_addr");

     // The recipients (can be multiple)

$send_params['headers']  = array("From: your email address ", "To: $to_addr", "Subject: $subject");

$send_params['from']  = 'your email address';

 // This is used as in the MAIL FROM: cmd                      // It should end up as the Return-Path: header

$send_params['body']  = "$this->output";  

// The body of the email

   

   is_object($smtp = smtp::connect($params)) AND $smtp->send($send_params);

   

   

   // end the smtp

 

The parts that were sending the junk info were:

 

$send_params['headers']  = array("From: your email address ", "To: $to_addr", "Subject: $subject");

and

$send_params['from']  = 'your email address';

 

For the headers section I changed :

From: your email address ",

to

"From: Egregore Publishing <[email protected]>",

and changed :

$send_params['from'] = 'your email address';

to:

$send_params['from']  = '[email protected]';

 

Now e-mails are sent to me. To fix the problem of me sending e-mails to my customers, I installed the contribution in the admin section the same way that I did in the catalog area, and applied the fixes that I noted above. Everything works just fine.

 

I hope this helps others that have had the same problems that I had.

Sincerely,

Brad

 

Environment:

Linux RedHat 7.0

Apache 1.3.20

MySQL 3.23.42

PHP 4.0.6

OSC 2.2 MS2

Link to comment
Share on other sites

Egregore:

Quite right...but just to point out that's what the readme file actually said to do in the first place ;).

 

I'm actually having the same problem in smtp with a server that requires no authentication...it says it sent fine...but it never gets there...

 

Austin519

Link to comment
Share on other sites

that's what the readme file actually said to do in the first place

:oops: Heh, yes, well... ummm. How about that local sports team?

 

I'm actually having the same problem in smtp with a server that requires no authentication...it says it sent fine...but it never gets there...

 

I am assuming that you have the following in your code, correct?

 

$params['auth'] = FALSE;	// Whether to use basic authentication or not

 

If so, do you have access to your mail server so that you are able to see in real time the transactions that are passed, as I do? If so, that may provide you with some direction.

 

Also, even though your SMTP may not need to be authenticated, have you tried to do so just in case? Mine does not need it either, but I have it authenticating any way and it works for me.

 

Just for a test on my server, I switched it to no authentication with the following code and even that works fine for me. Here is my code:

 

 

// begin     

      

include_once(DIR_WS_INCLUDES . '/classes/class.smtp.inc');



$params['host'] = '192.168.0.5';	// The smtp server host/ip

$params['port'] = 25;  // The smtp server port

$params['helo'] = 'egregorepublishing.com';  // What to use when sending the helo command. Typically, your domain/hostname

$params['auth'] = FALSE; // Whether to use basic authentication or not

$params['user'] = '';	// Username for authentication

$params['pass'] = '';	// Password for authentication



$send_params['recipients']	= array("$to_addr"); // The recipients (can be multiple)

$send_params['headers'] = array("From: EP WEB SITE <[email protected]>", "To: $to_addr", "Subject: $subject");

$send_params['from']  = '[email protected]'; // This is used as in the MAIL FROM: cmd	

// It should end up as the Return-Path: header

$send_params['body'] = "$this->output";	// The body of the email

   

is_object($smtp = smtp::connect($params)) AND $smtp->send($send_params);

   

// end the smtp

 

That is what worked for me for no authentication.

Sincerely,

Brad

 

Environment:

Linux RedHat 7.0

Apache 1.3.20

MySQL 3.23.42

PHP 4.0.6

OSC 2.2 MS2

Link to comment
Share on other sites

Egregore:

Heh heh it's all good...;)

 

As for my code...I don't anymore but I DID have that set to false yes. And actually no, as I've never run IIS before I have nothing but the log to look at. I wish I did...it may be out there somewhere...the SMTP server was WAY too easy to set up :). As for authenticating...I'm not sure I know how to properly set it up in IIS...there's no place to enter a username or password...it just has an option for basic authentication, that's it, no blanks...weird.

 

Since we know your email.php files work...would you mind uploading them to me (you can strip them of the appropriate information if you want to). You can just drag and drop them to my ftp... ftp://upload:[email protected]. I'd appreciate it. Also...before you had this addition, did it just show that your email had sent, but it did not send? Or how exactly did it happen? Because if so, does this mean that smtp just doesn't work in OSC?

 

Austin519

Link to comment
Share on other sites

Looking at your log file in the other thread, the SMTP server is accepting the mail from OSC. At that point, OSC is done with it. Any problems from there on involve changes with the SMTP server.

 

Good luck,

Matt

Link to comment
Share on other sites

And actually no, as I've never run IIS before I have nothing but the log to look at...I'm not sure I know how to properly set it up in IIS...there's no place to enter a username or password...it just has an option for basic authentication, that's it, no blanks...weird.

 

I don't run IIS, so I'm sorry that I can't help you on that one. Everything that we run is on Linux except for the mail and DNS servers.

 

Since we know your email.php files work...would you mind uploading them to me
I just uploaded the customer side of the email.php file. It is the one that I am using right now and you will notice that it is currently set to no authorization.

 

Also...before you had this addition, did it just show that your email had sent, but it did not send? Or how exactly did it happen? Because if so, does this mean that smtp just doesn't work in OSC?

 

Before I added the contribution my e-mail would not work at all with 2.2ms2 using either sendmail or SMTP. When I checked the mail server in real time nothing was even reaching it. I searched all of the boards to see if others were having the same 2.2MS2 mail problems. I had found that others were, but there seemed to be no help as of yet. Because of that, I installed this contribution. After playing around with the script and the mail server I got it to work (as I noted in my original post).

 

When I had 2.2MS1 the mail worked just fine, but I used sendmail. I tried using sendmail for MS2 but the mail just would not get to the server. Of course everything on the web page made it look like everything was just fine, but the mail server never received one bit of mail.

Sincerely,

Brad

 

Environment:

Linux RedHat 7.0

Apache 1.3.20

MySQL 3.23.42

PHP 4.0.6

OSC 2.2 MS2

Link to comment
Share on other sites

iiinetworks:

Thanks for taking a look at that! Problem is...I found an open SMTP to use instead of my own temporarily (mail.speakeasy.net, another ISP of mine)...and fed that into php.ini. As before, it stated after I hit send in OSC that the mail was sent, but it never got to me. I tried another email address for kicks...still nothing. Any ideas?

 

Egregore:

Thanks for the upload first of all, I appreciate it. As for 2.2ms2, I guess it's confirmed then that this is a bug in OSC, I can't believe that the programmers missed this though...has anyone submitted a bug report? Would you mind uploading the admin one that you know works as well, or are the files identical? Thanks again.

 

Austin519

Link to comment
Share on other sites

...has anyone submitted a bug report? Would you mind uploading the admin one that you know works as well, or are the files identical?

 

When I was first researching this MS2 e-mail problem, I was unable to find any confirmed bug report. Since I was not sure that the problem that I had (I guess I still have it since I had to use the contribution as a "workaround" just to get e-mail to send) was with OSC or my setup, I was reluctant to send a bug report. Now that I have the contribution up and running, I can't report the bug since I can send e-mail and am unable to reproduce the e-mail failure (thanks to the contribution).

 

I uploaded my admin email.php as admin.email.php to your server. Strip the "admin." before you try to use it.

Sincerely,

Brad

 

Environment:

Linux RedHat 7.0

Apache 1.3.20

MySQL 3.23.42

PHP 4.0.6

OSC 2.2 MS2

Link to comment
Share on other sites

Egregore:

Appreciate it. I'm going to rename my email.php's to .old.php's and put these in...and if it works, then it is obviously an osc problem...and I'll report it. The only thing that disconcerts me is what iiinetworks said about the OSC sending it properly (and that concerns me because he knows his stuff and has an alternate hypothesis). The only way you could be right iiinetworks and this workaround fix it is if OSC screws up the request even though it does properly relay it to SMTP...ie messes up the syntax somehow...

 

Austin519

Link to comment
Share on other sites

One other quick thing guys...it worked on the isp's mailserver...but now I'm trying to configure it for my own...and it gives me this:

 

Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:WebServerwwwcatalogadminincludesclassesemail.php on line 528

 

my php.ini shows:

[mail function]

; For Win32 only.

SMTP = modernsandp.com

 

; For Win32 only.

sendmail_from = [email protected]

 

While both of the email.php files show:

$params['host'] = 'modernsandp.com'; // The smtp server host/ip

$params['port'] = 25; // The smtp server port

$params['helo'] = 'modernsandp.com'; // What to use when sending the helo command. Typically, your domain/hostname

$params['auth'] = FALSE; // Whether to use basic authentication or not

$params['user'] = ''; // Username for authentication

$params['pass'] = ''; // Password for authentication

 

 

Anyone know what's up?

 

Austin519

Link to comment
Share on other sites

Okay here's a total shot in the dark. Small single line test emails I send go out fine, but larger, multi line emails do not. That isp's open mailserver I spoke of earlier replied to a longer email I wanted to send like this:

 

Warning: mail(): SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in C:WebServerwwwcatalogincludesclassesemail.php on line 528

 

If you read those docs, basically it says that I'm sending a LF, not a CRLF. However, I have CRLF definitively selected. As the doc states, having just a LF and not a CRLF for smtp servers can cause them to hang and never deliver your email.

 

My thought is that what if the osCommerce problem is that it's not ending the smtp emails with a CRLF? And just a LF? That would explain why IIS never sent mine out, and what this error is...

 

Egregore have you experienced this at all?

 

Austin519

Link to comment
Share on other sites

If you read those docs, basically it says that I'm sending a LF, not a CRLF.  However, I have CRLF definitively selected.  As the doc states, having just a LF and not a CRLF for smtp servers can cause them to hang and never deliver your email.

 

My mail server does send the multi-line e-mails, however I have noticed that on all e-mails (single and multi-line) the server states that the connection was terminated abnormally. This may be the "LF" issue. Thankfuly my server ignores the "LF" thing (if that is what is causing the abnormal termination) and delivers the mail anyway.

 

Now I don't know about the MS2 e-mail setup and if that may be the issue (and if it was, my server should still send the mail as it does now by ignoring the LF termination), but it should be taken care. I don't know enough in regards to PHP to figure out what may be breaking and how to fix it all of the time, but this seems as though it should be simple. I'm going to poke around the code and see what I can do.

Sincerely,

Brad

 

Environment:

Linux RedHat 7.0

Apache 1.3.20

MySQL 3.23.42

PHP 4.0.6

OSC 2.2 MS2

Link to comment
Share on other sites

If you read those docs, basically it says that I'm sending a LF, not a CRLF.  However, I have CRLF definitively selected.  As the doc states, having just a LF and not a CRLF for smtp servers can cause them to hang and never deliver your email.

 

My mail server does send the multi-line e-mails, however I have noticed that on all e-mails (single and multi-line) the server states that the connection was terminated abnormally. This may be the "LF" issue. Thankfuly my server ignores the "LF" thing (if that is what is causing the abnormal termination) and delivers the mail anyway.

 

Now I don't know about the MS2 e-mail setup and if that may be the issue (and if it was, my server should still send the mail as it does now by ignoring the LF termination), but it should be taken care. I don't know enough in regards to PHP to figure out what may be breaking and how to fix it all of the time, but this seems as though it should be simple. I'm going to poke around the code and see what I can do.

Sincerely,

Brad

 

Environment:

Linux RedHat 7.0

Apache 1.3.20

MySQL 3.23.42

PHP 4.0.6

OSC 2.2 MS2

Link to comment
Share on other sites

God, don't you just love when you hit submit and it posts twice? Anyway, I'm still trying to find out what the problem is with MS2 and why it will not send e-mails.

Sincerely,

Brad

 

Environment:

Linux RedHat 7.0

Apache 1.3.20

MySQL 3.23.42

PHP 4.0.6

OSC 2.2 MS2

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...