Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

sendmail + OSCommerce: Cannot send mail


desiredin

Recommended Posts

Hey everyone. Thanks for reading this.

 

My OS is OpenBSD. I'm running OsCommerce through my Apache webserver. I have PHP and MySQL running on it. I'm using sendmail as my smtp server, and am running my own DNS servers.

 

OScommerce installed no problem. Definatly thought it was too easy. :) Pics uploading and showing no problem. Admin directory has been password protected. My SSL cert is working great and the site is secure. But I encountered one roadblock I can't get past.

 

Luckily I have scheduled myself a realistic go-live date for two months from now. :) Which will be more than plenty to test everything and customize once working. Anyhow. On with the show.

 

I have read through the numerous threads here on the forums for past three days about mail problems. Eyes are bloodshot. Most posts are pertaining to Windows systems using SMTP, or getting error messages in OSCommerce. Neither of which seem to apply to me.

 

I can't send e-mail through OSCommerce. When I try to send it, in green at the top, it says it was sent out successfully. However, mail does not reach it's destination and my mail logs show no attempt was made to send mail through sendmail from OSCommerce.

 

I can send mail out no problem from my command prompt. My php.ini is set to send out via sendmail, and have properly specified my path to sendmail. I am not getting any error messages in my php error log, nor any php errors in my apache server logs for my domain.

 

So it seems OSCommerce is not connecting to my mail server, due to the fact the logs are empty. However, the logs are also showing no PHP errors.

 

Would you guess this is an issue with my PHP? Or an issue within OSCommerce and it's ability to utilize PHP to send mail? I would assume PHP would give an error if it couldn't handle a request, which leads me to swing towards OSCommerce being the culprit.

 

Can anyone offer some advice on this problem of mine?

 

Thanks a lot. :)

 

Wayne Stevenson

Link to comment
Share on other sites

I would suggest looking in your catalog subdir for a sendmail.log and see what it says, that's where my sendmail.log is for this program.

Thanks for the reply. I don't seem to have such a file. Is this file put there by your ISP (maillog)? Is it generated by OSCommerce? Which file can I specify OSCommerce to log mail activity in?

 

Thanks.

 

Wayne Stevenson

Link to comment
Share on other sites

I would suggest looking in your catalog subdir for a sendmail.log and see what it says, that's where my sendmail.log is for this program.

Thanks for the reply. I don't seem to have such a file. Is this file put there by your ISP (maillog)? Is it generated by OSCommerce? Which file can I specify OSCommerce to log mail activity in?

 

Thanks.

 

Wayne Stevenson

No, it's generated by sendmail if sendmail working at all for OSC

Best Regards

Link to comment
Share on other sites

I would suggest looking in your catalog subdir for a sendmail.log and see what it says, that's where my sendmail.log is for this program.

Thanks for the reply. I don't seem to have such a file. Is this file put there by your ISP (maillog)? Is it generated by OSCommerce? Which file can I specify OSCommerce to log mail activity in?

 

Thanks.

 

Wayne Stevenson

No, it's generated by sendmail if sendmail working at all for OSC

My log that sendmail generates does not show any attempt to send mail form my web site at all.

Link to comment
Share on other sites

Well in that case go to your admin and check in the section that says My Store, on the left side of the screen in the menu look for E-Mail Options, E-Mail Transport method, the Value should be set to sendmail, try that.

It's set to sendmail. PHP.ini is set with the proper path as well. When I send mail through OSC, it says it was successful, without error messages, but my sendmail logs remain empty, and the mail doesn't get delivered, not sent.

Link to comment
Share on other sites

Which operating system are you using, shouldn't matter, just wondering, that's wierd, cause it sure enough works for me. Are you sure sendmail is working with other apps.

I'm running OpenBSD. More details of my setup are listed in my inital post. If you need any more info about the setup, let me know.

 

I haven't worked sendmail with other apps. It does work fine from the command prompt.

Link to comment
Share on other sites

Which operating system are you using, shouldn't matter, just wondering, that's wierd, cause it sure enough works for me. Are you sure sendmail is working with other apps.

I'm running OpenBSD. More details of my setup are listed in my inital post. If you need any more info about the setup, let me know.

 

I haven't worked sendmail with other apps. It does work fine from the command prompt.

I'm at a disadvantage with OpenBSD, I know nothing about it, the only other thing I can think of is maybe, if not, sendmail might need to be in the path.

 

Another place to check about this is at http://my.abstrakt.ch/blog/archives/000003.php

Best Regards

Link to comment
Share on other sites

Can anyone point me to a basic php script that will test the functionality of my php and sendmail together and generate output to my screen when run letting me know what happened when run?

 

Thanks. :)

 

I named this testsendmail.php and put it in my root subdir, it doen't generate anything on the screen, maybe some one else can add to this so it does.

 

<?php

ini_set('sendmail_path', 'xxxx/sendmail -t -i');

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

?>

 

I got this one and it works for me, just change the path and e-mail addy for yourself.

Best Regards

Link to comment
Share on other sites

  • 1 month later...

Hello everyone,

 

First, please let me thank you all for your contributions here on the board and elsewhere. All of your posts have been incredibly helpful in making a great shopping site.

 

It seems I have come to a stopping point, where I could use a little help.

 

I am not able to get any email to work through oscommerce. However, I have gotten a test script to work:

<?php

ini_set('sendmail_path', '/usr/bin/sendmail -t -i');

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

?>

 

I was able to get this to work by adding the sendmail flag at the end of the function "-f" followed by the e-mail address mail is sending from.

 

I'm on a virtual Linux server.

 

I have tried adding the address: [email protected] in the administration email panel but it doesn't work.

 

I'm curious if anyone could assist me in letting me know where and how to use this "-f" function within osCommerce.

 

Thank you very much in advance for any help you might be able to provide.

 

Happy new year!

Link to comment
Share on other sites

Hello everyone,

 

First, please let me thank you all for your contributions here on the board and elsewhere. All of your posts have been incredibly helpful in making a great shopping site.

 

It seems I have come to a stopping point, where I could use a little help.

 

I am not able to get any email to work through oscommerce. However, I have gotten a test script to work:

<?php

ini_set('sendmail_path', '/usr/bin/sendmail -t -i');

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

?>

 

I was able to get this to work by adding the sendmail flag at the end of the function "-f" followed by the e-mail address mail is sending from.

 

I'm on a virtual Linux server.

 

I have tried adding the address: [email protected] in the administration email panel but it doesn't work.

 

I'm curious if anyone could assist me in letting me know where and how to use this "-f" function within osCommerce.

 

Thank you very much in advance for any help you might be able to provide.

 

Happy new year!

Is this your server or a host?

 

If it's your server do you have this path '/usr/bin/sendmail -t -i'); in your php.ini file and is sendmail in your '/usr/bin/ subdir sometimes it helps to have '/usr/bin/sendmail.exe -t -i'); as well.

Best Regards

Link to comment
Share on other sites

ini_set('sendmail_path', '/usr/bin/sendmail -t -i [email protected]');

put it in the includes/classes/email.php file prior to the declaration of class email (i.e. on line 19 or 20).

 

Alternately, you could try changing (around line 500 of includes/classes/email.php):

        return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));

to

        return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers), '-f' . $from);

Hth,

Matt

Link to comment
Share on other sites

Thanks John and Matt,

 

Those are both excellent ideas. John, unfortunately I don't have access to the php.ini file. I'm on a shared server.

 

Matt, I tried your ideas and some variations of them.

 

Nothing continues to work. But thanks for your help.

 

If something else occurs to you I'd love any ideas.

 

Thank you very much.

Sage

Link to comment
Share on other sites

This might be a lot of work, but I would try replacing

        return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));

with

ini_set('sendmail_path', '/usr/bin/sendmail -t -i');
mail('[email protected]', 'Test', 'Is this working?', "From: [email protected]\nMIME-Version: 1.0","[email protected]");

and see if it sends email. If it doesn't, then there is something wrong with the way it is being called. You might have to change some of the admin > Configuration > E-Mail Options.

 

If it does work, try switching each term to match the original statement, i.e. replace '[email protected]' with $to, etc. At least then you can figure out what's causing the problem.

 

Hth,

Matt

Link to comment
Share on other sites

I'm having a very similar problem except mine is on redhat 9.0 with apache 2.0.40

PHP 4.2.2...it will send to my domain mail but not to aol,hotmail, yahoo or certain webmail services...can't figure this out...this has got to be a bug. We even decided to switch servers...every other php app we use sendsmail fine, thru sendmail...this has got to be a bug. PLEASE HELP

Link to comment
Share on other sites

Ok I modified that test script to this:

 

<?php 
ini_set('sendmail_path', '/usr/sbin/sendmail -t -i');
mail('[email protected]', 'Test', 'Is this working? usr sbin sendmail', "From: [email protected]\nMIME-Version: 
1.0","[email protected]");
?>

 

I also tried both sendmail paths:

 

'/usr/sbin/sendmail -t -i'   and    '/usr/bin/sendmail -t -i'

 

 

They both worked fine...got the email from both...so i know it's not the server or its php.ini file...

 

so what else could it be?

Link to comment
Share on other sites

  • 2 months later...

I have also had a go at this.

 

I know that the server works it's the script that doesn't so I need a fix.

 

I've looked and looked but I can't find a thing that helps.

 

At the moment all emails sent by the script to a hotmail address are put in my customers filter file / blocked

 

example

Emails sent at reg to a @hotmail.com address go through but not when an email is sent via "tell a friend"

 

if I change:

 

ini_set('sendmail_path', '/usr/bin/sendmail -t -i');
mail('[email protected]', 'Test', 'Is this working?', "From: [email protected]\nMIME-Version: 1.0","[email protected]");

 

Then an email gets through? very strange

So is it the headers? What should I change?

 

I have looked and tested a number of other sites found on this fourm and it would seem I'm not the only one having this problem

 

Please help

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...