Fredrik.r Posted August 13, 2006 Share Posted August 13, 2006 The hosting company I am using upgraded to PHP 5 without notice. Since then no emails are sent out. We get no order confirmation emails and when trying to email customers from osCommerce admin, the emails never reaches them. When using an email client it works though, so this must be an issue with osCommerce and not the e-mail itself. Please help me. I am trying to inform all customers that the site is online again after having technical problems, but I can't. Link to comment Share on other sites More sharing options...
Fredrik.r Posted August 13, 2006 Author Share Posted August 13, 2006 I have checked that the email classes in admin and catalog are the same as in the latest osCommerce. Still no emails at all from the shop.. My hosting says php's mail() is working. Link to comment Share on other sites More sharing options...
Fredrik.r Posted August 13, 2006 Author Share Posted August 13, 2006 Still no luck with this. I'm desperate, please help me if you have an idea. Link to comment Share on other sites More sharing options...
berkedam Posted August 13, 2006 Share Posted August 13, 2006 <?php ini_set('sendmail_path', '/usr/sbin/sendmail -t -i'); mail('your_other_e-mail_address@other-e-mail_address.tld', 'Test', 'Do I get this mail?', "From: your_email_address@your_website.tld\nMIME-Version: 1.0"); ?> Name this file: test_mail.php Upload to: website Call the file in you browser and "Enter", page will remain blank. Wait a few seconds/ minutes and see if it is delivered to your e-mail box "If you're working on something new, then you are necessarily an amateur." Link to comment Share on other sites More sharing options...
Fredrik.r Posted August 13, 2006 Author Share Posted August 13, 2006 Hi John! Thank you. I tested it but it doesn't work. I also tried with their path to sendmail. I have also tried below (found here) but I suppose that is for Windows and SMTP. This fixed it for me: 3 Jan 2006 09:23:15 edvalson (AT) atlantic (DOT) net This is caused by problems in how the OSCommerce script sends the friendly names through the php mail function. When I watched my logs, PHP mail() would essentially send the following line to my smtp server: MAIL FROM: < Friendlyname<[email protected]>> While this may work for unix mail servers, windows will bounce this syntax back as an invalid address. I changed the line generating the from line as follows: FROM: return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers)); TO: return mail($to_addr, $subject, $this->output, 'From: ' . $from_addr . $this->lf . 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers)); Essentially sending two FROM headers - the first one being compatible with MS mail servers, and the second being read by the email clients for display. This is a bug in OSCommerce that really should be resolved. Link to comment Share on other sites More sharing options...
berkedam Posted August 13, 2006 Share Posted August 13, 2006 Hi John! Thank you. I tested it but it doesn't work. It should. Talk to your hoster and ask them why the file is not working "If you're working on something new, then you are necessarily an amateur." Link to comment Share on other sites More sharing options...
Fredrik.r Posted August 13, 2006 Author Share Posted August 13, 2006 I have tried these, do they seem to be correct? The one above should be their path to sendmail. Of course I did use other email addresses, two different. <?php ini_set('sendmail_path', '/usr/local/bin/mini_sendmail?-smail.trekia.se?-t'); mail('[email protected]', 'Test', 'Do I get this mail?', "From: [email protected]\nMIME-Version: 1.0"); ?> <?php ini_set('sendmail_path', '/usr/sbin/sendmail -t -i'); mail('[email protected]', 'Test', 'Do I get this mail?', "From: [email protected]\nMIME-Version: 1.0"); ?> Link to comment Share on other sites More sharing options...
Fredrik.r Posted August 14, 2006 Author Share Posted August 14, 2006 Well, it's working now. The hosting company changed mail client. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.