The mail() function requires that the server have sendmail running; our UNIX servers do run sendmail in submit-only mode to permit form processing. However, they are configured so that you must use the "-f" flag to set a "from" address on the outgoing message; this prevents many form vulnerabilities that allow spammers to hijack CGI scripts.
PHP allows you to send flags to sendmail using an optional fifth parameter in the function. You would therefore use:
mail($destinationaddress, $subject, $message, $extraheaders,
'-f' . $fromaddress);
The fourth and fifth parameters are usually optional. However, it's wise to use the fourth to include a "From: " header, and the fifth is required to send the -f flag.