|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-04-15 03:42 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Apr 01 10:00:02 2026 UTC |
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