note 23684 added to function.mail

From: Date: Wed, 24 Jul 2002 21:38:54 +0000
Subject: note 23684 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-33527@lists.php.net to get a copy of this message
The latest versions of PHP won't allow multiple arguments to be sent to sendmail. (Anything after the first space character is ignored.) This function works around this limitation by talking to sendmail directly using a pipe. Use this in place of mail() if you need to send multiple flags to sendmail: 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); } -- http://www.php.net/manual/en/function.mail.php http://master.php.net/manage/user-notes.php?action=edit+23684 http://master.php.net/manage/user-notes.php?action=delete+23684 http://master.php.net/manage/user-notes.php?action=reject+23684

« previous php.notes (#33527) next »