surpas122 Posted January 7, 2005 Posted January 7, 2005 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. :'(
peterr Posted January 7, 2005 Posted January 7, 2005 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. :'( <{POST_SNAPBACK}> 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
Guest Posted January 7, 2005 Posted January 7, 2005 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');
peterr Posted January 7, 2005 Posted January 7, 2005 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
surpas122 Posted January 8, 2005 Author Posted January 8, 2005 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 <{POST_SNAPBACK}>
surpas122 Posted January 8, 2005 Author Posted January 8, 2005 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 <{POST_SNAPBACK}> 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)); }
kiwihawk Posted January 10, 2005 Posted January 10, 2005 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 <{POST_SNAPBACK}> Could you tell me a bit more about where exactly this code would go?
peterr Posted January 10, 2005 Posted January 10, 2005 Hi, Could you tell me a bit more about where exactly this code would go? <{POST_SNAPBACK}> /includes/application_top.php would be the best place. Peter
kiwihawk Posted January 10, 2005 Posted January 10, 2005 Hi,/includes/application_top.php would be the best place. Peter <{POST_SNAPBACK}> Worked great thanks. Now if only I can get the darn thing to send me an email when someone buys something! :(
Recommended Posts
Archived
This topic is now archived and is closed to further replies.