RoseCamp Posted June 19, 2007 Share Posted June 19, 2007 Wondered if this might help people having trouble with sending emails to their store out of osCommerce... In test mode, when I send emails from the website with all the email addresses in Admin \Config \My Store to my personal email ([email protected]), all emails work. However, in the live site (www.mydomain.co.nz), when the email addresses are set to [email protected], it only sends emails to other email addresses (i.e. NOT [email protected]). So, the customer gets their email detailing the order, but the shop doesn't get their copy. osCommerce thinks it's sending the emails, so it seems to be getting lost after that. Some background to my site... * It is on a web host server (i.e. my site is not the only website on it). * It is a Linux server so I have configured to use sendmail rather than SMTP. I implemented Sheridan's changes to set up the Reply_To and ReturnPath on the email, in case any anti-spam software was checking that the From was the same as the ReplyTo. This didn't fix the problem. But may work for you, here's the original link.... http://www.oscommerce.com/forums/index.php?sho...ridan&st=20 I have put a summary of Sheridan's suggested changes at the bottom of this post. Then I tried Harold's email testing contribution. It said that the emails worked but they didn't turn up. http://www.oscommerce.com/community/contributions,1595 Then I contacted my Web Hosting company and this is what they came back with... >I have figured out what is happening here. You have your own mail >server for canplay.org.nz hosted elsewhere (on the server in our office). > However our web host servers are >smart, and know that canplay.org.nz is hosted on the local server, so >the server doesnt bother to check where the mail is supposed to go, it >just delivers it to itself. > >If you want the messages to be delivered to your mail server we will >need to turn off the mail services for canplay.org.nz on the server. I am going to try this tomorrow and see if resolves the problem. Hopefully it won't cause any others.!! Our network guy thinks it's a slightly different problem... >So by the sound of it you’re trying to send emails from [email protected] >to [email protected]. But you are not actually sending emails from >canplay.org.nz but some other host out on the internet. I imagine that >your CanPlay server is blocking the incoming email for this reason. I >have tested doing this myself and it did not get through. > >I’d suggest testing sending from a different address (anything but >[email protected] – maybe something more indicative of >where it is coming from) and putting the ‘reply to’ as [email protected]. This seems to conflict with Sheridan's advice (about having the From and Reply to as the same). But will see. Cheers Rose ************************************************************************* And here is a summary of what Sheridan suggested is changed... Some hosting packages on shared servers have a fixed "Return-Path" address in their php.ini file. This email address is of a dummy address e.g. "[email protected]" This is the email address to which "undeliverable mail" errors are sent It can not be changed, on some servers by some hosting providers, using .htaccess or using php ini_set. The problem arrises as some spam filters block the reciept of emails with unrelated "ReplyTo" and "Return-Path" address. ISPs which do this include Hotmail, Yahoo and many big ISPs. So the solution is to re-write the email headers which are causing the spam filter to block receipt of the emails. Thus the code I supplied works by re-writing the "Return-Path" and "Reply-To" headers. It is not a matter of emails not being sent but spam filters on the recieving end blocking them due to the headers varying. You just need to change the two general.php files with the code supplied and no more emails should be blocked due to this issue. The two files to change are:- catalog/includes/functions/general.php catalog/admin/includes/functions/general.php Use the second code change I posted earlier not the first i.e. :- $returnpath="Return-Path: <$from_email_address>"; $replyto="Reply-To: <$from_email_address>"; $mailerreplyreturn = array(1 => 'X-Mailer: osCommerce Mailer', $returnpath, $replyto); $message = new email($mailerreplyreturn); The code changes in the above files should set the "Return-Path" and "Reply-To" headers to the value entered in the "Your E-Mail Address:" field. This results in an email with the same values for the "From" "Return-Path" and "Reply-To" headers. It works with these settings at least:- E-Mail Transport Method sendmail E-Mail Linefeeds LF Use MIME HTML When Sending Emails false Verify E-Mail Addresses Through DNS false Send E-Mails true Link to comment Share on other sites More sharing options...
RoseCamp Posted June 22, 2007 Author Share Posted June 22, 2007 So the good news is that once the mail services were turned off on my web host, the emails to my own domain got thru aok. Success at last! :thumbsup: Link to comment Share on other sites More sharing options...
hnt5e019 Posted June 28, 2007 Share Posted June 28, 2007 So the good news is that once the mail services were turned off on my web host, the emails to my own domain got thru aok. Success at last! :thumbsup: Hi Rose, I'm helping out a friend who appears to be having the same problem you have described. That is, when a customer places an order, he does not receive and email with the descriptions/quantities of the order. Instead, he must either contact the customer and asked what it was they ordered or dig through his admin stuff to find and then match the order to his customer. Can I assume that this is the problem you were having? If so, I would like to make changes to both the general.php files as you described but I need a little bit more detailed hand holding to make sure I don't mess up his store. :blush: Will I simply replace only this: $message = new email(array('X-Mailer: osCommerce')); with all the code change you supplied or is there more in the original general.php that I missed that will be replaced by your given code? As additional info, his site is hosted elsewhere (and assuming Windows based, not Linux due to using smtp instead of sendmail and is using CRLF) and the "send extra order emails" is populated with his ISP's webmail (not throwaway mail like AOL, Hotmail, Yahoo, etc.) I am NOT a guru with this stuff, but I do want to help him out and it seems your post is the closest to his problem. I am not proud to ask you to explain in bright crayon! Thanks a whole lot for any help!!! Link to comment Share on other sites More sharing options...
dioxyd Posted July 7, 2007 Share Posted July 7, 2007 Hello, I decided to use osCommerce after having some bad experiences on other carts. But now, I am having the same problem with you guys. It is nice to see you guys are having same problem too :P Anyway, actually i am sad to have this bug. I read the whole story but I couldn't get which parts I must change in general.php files? I am using the last osCommerce 2.2 Can someone make it a bit more clear? Link to comment Share on other sites More sharing options...
RoseCamp Posted July 22, 2007 Author Share Posted July 22, 2007 Hi Rose, I'm helping out a friend who appears to be having the same problem you have described. That is, when a customer places an order, he does not receive and email with the descriptions/quantities of the order. Instead, he must either contact the customer and asked what it was they ordered or dig through his admin stuff to find and then match the order to his customer. Can I assume that this is the problem you were having? If so, I would like to make changes to both the general.php files as you described but I need a little bit more detailed hand holding to make sure I don't mess up his store. :blush: Sorry for not responding. I hadn't checked this topic, after the first week. I have a habit of providing too much info I think! I did make Sheridan's changes, but I don't believe now that I needed to. I would guess that you don't need to either... There seems to be a problem when the website is hosted somewhere different from the mail server. i.e. our website it hosted externally, and we have the mailserver on our in-office server. If the website server has mail services turned on, it will grab the emails that the website is sending to itself and won't send them on to the mail server (on another computer). It's trying to be smart but isn't! Just ring the web host provider and discuss with them. Ask them to turn the mail services off as a trial and see if it makes a difference. I guess also discuss what effect they think turning it off will have. If you find you do need to install Sheridan's changes, you might find the answer in her link. (in my original post). But yes, from memory, you just replace the original $message line with the four lines given. Cheers Rose Link to comment Share on other sites More sharing options...
RoseCamp Posted July 22, 2007 Author Share Posted July 22, 2007 Hello,I decided to use osCommerce after having some bad experiences on other carts. But now, I am having the same problem with you guys. It is nice to see you guys are having same problem too :P Anyway, actually i am sad to have this bug. I read the whole story but I couldn't get which parts I must change in general.php files? I am using the last osCommerce 2.2 Can someone make it a bit more clear? I don't think this is a problem with osCommerce. I think it is a problem with the mail server software operating on your web server. Is your website on the same computer as your email server? If they are on different servers, you need to talk to your web host to turn of the mail server software. (see my reply above). If not, just replace the $message line of code in /function/general.php as follows... 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 // Jun '07: Set up our email address in Reply To, Return Path to ensure emails are not blocked. // $message = new email(array('X-Mailer: osCommerce Mailer')); $returnpath="Return-Path: <$from_email_address>"; $replyto="Reply-To: <$from_email_address>"; $mailerreplyreturn = array(1 => 'X-Mailer: osCommerce Mailer', $returnpath, $replyto); $message = new email($mailerreplyreturn); Hope this is clearer! Rose Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.