note 12188 deleted from function.mail by jimw
| From: | jimw@php.net | Date: | Wed, 31 Oct 2001 23:14:17 +0000 |
| Subject: | note 12188 deleted from function.mail by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-19903@lists.php.net to get a copy of this message | ||
This modified version of the function someone posted before works for me:
function mailfrom($fromaddress, $toaddress, $subject, $body, $headers) {
$fp = popen('/usr/sbin/sendmail -t -f '.$fromaddress.'
'.$toaddress,"w");
if(!$fp) return false;
fputs($fp,"From:".$fromaddress."\r\n");
fputs($fp, "To: $toaddress\r\n");
fputs($fp, "Subject: ".$subject."\r\n");
fputs($fp, $headers."\r\n");
fputs($fp, $body);
fputs($fp, "\r\n");
pclose($fp);
return true;
}