Doc #78018 [NEW]: mail() expects parameter 4 to be string
| From: | 888 at foshin dot com | Date: | Wed, 15 May 2019 19:07:08 +0000 |
| Subject: | Doc #78018 [NEW]: mail() expects parameter 4 to be string | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-16655@lists.php.net to get a copy of this message | ||
From: 888 at foshin dot com
Operating system:
PHP version: 7.2.18
Package: Mail related
Bug Type: Documentation Problem
Bug description:mail() expects parameter 4 to be string
Description:
------------
---
From manual page: https://php.net/function.mail
---
"Warning: mail() expects parameter 4 to be string, array given" even
though the manual says "String or array to be inserted at the end of the
email header." and "If an array is passed, its keys are the header names
and its values are the respective header values.".
Test script:
---------------
mail("Joe <joe@joe.com>", "Bug", ":(", array("From"
=> "Joe
<joe@joe.com>", "To" => "Joe <joe@joe.com>",
"Reply-To" => "Joe
<joe@joe.com>", "X-Mailer" => "NOOOooo", "MIME-Version"
=> "1.0",
"Content-type" => "text/html; charset=utf-8", "Date" =>
date("r")))
Expected result:
----------------
No warning and the mail function actually working.
Actual result:
--------------
"Warning: mail() expects parameter 4 to be string, array given"
--
Edit bug report at https://bugs.php.net/bug.php?id=78018&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78018&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78018&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78018&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=78018&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78018&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78018&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78018&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78018&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78018&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78018&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78018&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78018&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78018&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78018&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=78018&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78018&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78018&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78018&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78018&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78018&r=mysqlcfg