Doc #78018 [Opn->Fbk]: mail() expects parameter 4 to be string

From: Date: Wed, 15 May 2019 19:11:00 +0000
Subject: Doc #78018 [Opn->Fbk]: mail() expects parameter 4 to be string
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16656@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78018&edit=1 ID: 78018 Updated by: peehaa@php.net Reported by: 888 at foshin dot com Summary: mail() expects parameter 4 to be string -Status: Open +Status: Feedback Type: Documentation Problem Package: Mail related PHP Version: 7.2.18 Block user comment: N Private report: N New Comment: Are you sure you are on 7.2? Previous Comments: ------------------------------------------------------------------------ [2019-05-15 19:07:08] 888 at foshin dot com 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 this bug report at https://bugs.php.net/bug.php?id=78018&edit=1

« previous php.doc.bugs (#16656) next »