|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #830 Make a 'from' parameter in the mail() function.
Submitted: 1998-10-07 11:06 UTC Modified: 1998-10-10 18:48 UTC
From: ca at kvl dot dk Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 3.0.5 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ca at kvl dot dk
New email:
PHP Version: OS:


 [1998-10-07 11:06 UTC] ca at kvl dot dk
I kindly suggest that you make a 'from' parameter in the mail function, like: mail($to,$from,...) or mail($to,...,$from) to comply with the current syntax. This will surely give the programmers more flexibility and it is required if you have the same PHP server running multiple sites with individual mailservers. Besides, it is syntactically more correct give the 'from' email-address in the parameter form rather than in the 'sendmail_from' parameter in the 'php3.ini' file, or even worse, having to modiffy this parameter manually prior to executing the mail()-function. 

Claus Andersson


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-10-10 18:48 UTC] jim
You can simply pass a From: header in the fourth parameter to mail() -- ie:

mail($to, $subject, $message, "From:\nX-Mailer: PHP-Script/1.0");

You may need to tweak your sendmail configuration to allow this forging of the From: header,
but that would be true even if it were built-in to PHP.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 28 14:01:28 2024 UTC