Guest Posted March 6, 2003 Share Posted March 6, 2003 Hope I'm asking this in the right forum. All my mail stopped working, and I find I need to add the"-f" switch to the mail() function, so that a correct From header is sent. Anyone know where on catalog/includes/classes/email.php I add it? the version I'm using is: email.php,v 1.1.1.1 2002/11/28 23:22:41. Should it be part of the $xtra_headers array? Link to comment Share on other sites More sharing options...
Guest Posted March 7, 2003 Share Posted March 7, 2003 On some servers, in the email function, you must have a fith option in the mail() function to set the from header. (See http://www.php.net/manual/en/function.mail.php scroll to the bottom and read the user comments for more info). That is where I found the answer that works for me, using the ini_set() function. Open /catalog/includes/classes/email.php and at around line 501, change: else { return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers)); } to else { ini_set(sendmail_from, "me@mydomain.com"); return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers)); ini_restore(sendmail_from); } Read more about the ini_set() function at http://www.php.net/manual/en/function.ini-set.php Hope this helps someone. Link to comment Share on other sites More sharing options...
csokolov Posted November 28, 2005 Share Posted November 28, 2005 Thank you very much for sharing your work with all. I appreciate this. However, this fix has not worked for me. My "Return-To" still reads "apache@mydomain.com" instead of the value I entered in the script modifications. Any thoughts? Thanks, Christopher. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.