php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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. 

Best,
Claus Andersson

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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: me@there.com\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 Apr 24 08:01:29 2024 UTC