When PHP calls sendmail, the httpd's user is used as the mail sender (www, or httpd in your case).
There's a 5'th parameter for mail, called "additional parameters". Here you can pass parameters directly to sendmail. Just provide "-fautomail@mydomain.com" as the 5'th parameter to the mail() call.
From the sendmail man pages:
"fname Sets the name of the from'' person (i.e., the sender of the
mail). -f can only be used bytrusted'' users (normally
root, daemon, and network) or if the person you are trying to
become is the same as the person you are.
"
from
http://www.redhat.com/support/resources/howto/RH-sendmail-HOWTO/c420.html