| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2002-01-02 09:20 UTC] miki at canaan dot co dot il
 mail command accept:
mail ($recipient, $subject, $message [, string additional_headers]);
all good.
But when I construct all the mail from headers I don't need to supply: $recipient, $subject, $message as they all exist in the headers.
So I do:
mail ("", "", "", $headers);
The problem is that even when I write the "To:" header in the headers another empty "To:" appear next to it.
So for maximal flexibility I think that $headers suppose to override all other fields.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 13:00:02 2025 UTC | 
The strength of PHP is to give people functions which they can use, without understanding the mechanisms behind it. Why not just obsolete set_cookie() ? You could do this manually with header() (the code doesn't even get longer, you just have to pay attention how to format the cookie-parameters). yes, you could even obsolete mail() and leave it up to the user to either open a pipe to sendmail (un*x) or connect to an SMTP server (windows). there are dozens of core PHP functions which can be replaced by an equivalent piece of code IN PHP. but this "feature richness" just makes PHP so popular. why tempnam()? you could write this very elegantly in PHP, too: do { $tmp=substr(md5(microtime()),0,8); } while(file_exists($tmp)); I hope nobody disagrees with setting this to "bogus". Kind Regards, Daniel Lorch