Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

php.ini file


surpas122

Recommended Posts

Posted

Hello,

 

Is there another way to get the email functions to work without updating the php.ini file. Our site is on a server where the php.ini file is restricted.

 

Hosting company wrote:

 

The php.ini file is a Server wide file and as such, access is restricted.

 

Also, there is NOT a send_from in the php.ini because it would not be proper for web site xyz.com's email to be sent from your site.

 

Don't you have a way to set your send_from in your .php code?

 

 

Is this possible to set the send_from somewhere else? Or should we just seek a new host?

 

Thanks. :'(

Posted

Hi,

 

Is there another way to get the email functions to work without updating the php.ini file.  Our site is on a server where the php.ini file is restricted.

 

Hosting company wrote:

 

The php.ini file is a Server wide file and as such, access is restricted.

 

Also, there is NOT a send_from in the php.ini because it would not be proper for web site xyz.com's email to be sent from your site.

 

Don't you have a way to set your send_from in your .php code?

Is this possible to set the send_from somewhere else?  Or should we just seek a new host?

 

Thanks. :'(

 

1. You can set the 'send from' in admin, is that not working ?

 

2. If you cannot access/modify PHP.INI, then you _should_ be able to use PHP directives in your .htaccess file, if not, I'd start to seek a new host, as you say.

 

What are you actually having problems with ? Do emails have no "From:" value ?

 

Peter

Posted

surpas122,

 

Add the following lines in /catalog/classes/email.php and admin/classes/email.php

before the mail() function is called.

 

ini_set('sendmail_from','[email protected]');

 

If the SMTP server is not specified in php.ini add the following line as well.

ini_set('SMTP','smtpserver.domain.com');

Posted
Hi,

1. You can set the 'send from' in admin, is that not working ?

 

2. If you cannot access/modify PHP.INI, then you _should_ be able to use PHP directives in your .htaccess file, if not, I'd start to seek a new host, as you say.

 

What are you actually having problems with ? Do emails have no "From:" value ?

 

Peter

 

 

I am on a Windows Server and I have the email options set to SMTP and CRFL.

The E-mail From is set in "My Store".

 

Here is the code line in my email.php:

 

if (EMAIL_TRANSPORT=="SMTP") {

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));

} else {

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

}

Posted
Hi,

 

As the function is not available on all servers this is more conventional:

 

if (function_exists('ini_set')) @ini_set('sendmail_from','[email protected]');

 

Peter

 

Could you tell me a bit more about where exactly this code would go?

Posted
Hi,

/includes/application_top.php would be the best place.

 

Peter

 

Worked great thanks.

 

Now if only I can get the darn thing to send me an email when someone buys something! :(

Archived

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

×
×
  • Create New...