#41091 [NEW]: mail() Function only allows 5 arguments

From: Date: Sun, 15 Apr 2007 02:58:20 +0000
Subject: #41091 [NEW]: mail() Function only allows 5 arguments
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-111494@lists.php.net to get a copy of this message
From: justinbrinkerhoff at gmail dot com Operating system: Ubuntu 6.10 Edgy Eft PHP version: 4.4.6 PHP Bug Type: Feature/Change Request Bug description: mail() Function only allows 5 arguments Description: ------------ Hi, I ran accross something while writing an e-mail contact form for a customer. I have hosting provider still on PHP 4.3.2. I am changing providers soon though. But anyways, what I noticed is the mail() function only allows 5 arguments. So, what I wanted to ask/propose, is to see if perhaps I can suggest/request there be 7 - 10 arguments allowable in the mail() function. Five seems a bit limited, and I think a max of 10 would be reasonable. Beyond 10 would probably be a little rediculous, but 10 should suffice. I don't see this as necessarily a "bug" per say, but a feature that would make it a lot easier. Here is an example of the problem at hand. Reproduce code: --------------- //HTML Form Code - ContactUs.html <form name="email" method="post" action="mail.php"> Name <input type="text" name="name" id="name" /> Address <input type="text" name="addr" id="addr" /> E-Mail <input type="text" name="from" id="from" /> Message <textarea rows="10" cols="20" name="notes" id="notes"></textarea> <input type="submit" value="SEND" /> </form> //PHP Code - mail.php <?php $date = date(r); $to = "support@example.com"; $from = $_POST['from']; $subject = "Example.com Support Inquiry - From Website"; $message = $_POST['notes']; $address = $_POST['addr']; if(mail($to, $date, $from, $subject, $message, $address)) { echo "Message Sent"; } else { echo "Message Failed"; } ?> Expected result: ---------------- Page should say: Message Sent Actual result: -------------- Warning: mail() expects at most 5 parameters, 6 given in /var/www/html/mail.php on line 8 Message Failed -- Edit bug report at http://bugs.php.net/?id=41091&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41091&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41091&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41091&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41091&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41091&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41091&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41091&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41091&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41091&r=support Expected behavior: http://bugs.php.net/fix.php?id=41091&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41091&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41091&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41091&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41091&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41091&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41091&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41091&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41091&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41091&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41091&r=mysqlcfg

« previous php.bugs (#111494) next »