In order to correctly send mail with PHP through our servers, an extra paramater needs to be added to the mail() function with PHP. See our sending mail with PHP FAQ for more general details.
osCommerce does not add this extra paramater by default, so a quick change is needed to configure osCommerce to properly send mail.
In /catalog/includes/classes and /catalog/admin/includes/classes there is a document called email.php. This document controls most if not all e-mail functions within osCommerce.
You can either Download a modified version of email.php here, and replace your email.php on the server with this modified version, or make the changes below to your email.php. Generally, we recommend just downloading the file, unless you've further customized email.php
Around line 500, you'll see:
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));
}
}
Modify each instance of the mail() command to include the fifth paramater. Be very careful with the parentheses -- there should only be one parenthesis at the end of the command.
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),'-f' . $from_addr);
} else {
return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers),'-f' . $from_addr);
}
}