note 23684 deleted from function.mail by sp
| From: | sp@php.net | Date: | Tue, 11 Oct 2005 20:26:34 +0000 |
| Subject: | note 23684 deleted from function.mail by sp | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96864@lists.php.net to get a copy of this message | ||
Note Submitter: scott at criticalpath dot com
----
This can be used in place of mail()
<?php
function sendmail($to='', $subject='', $message='',
$headers='', $extra='')
{
$fd = popen("/usr/sbin/sendmail -t $extra", 'w');
fputs($fd, "To: $to\n");
fputs($fd, "Subject: $subject\n");
fputs($fd, "X-Mailer: PHP4\n");
if ($headers) {
fputs($fd, "$headers\n");
}
fputs($fd, "\n");
fputs($fd, $message);
pclose($fd);
}
?>