I have the php mail script the emails data posted from a form. The script works perfectly apart from when the emails arrive they have Apache@mydomain.com as the senders address instead of myname@mydomain.com.
These two global variables are defined in the script
$strTo = myname@mydomain.com
$strFrom = user@theirdomain.com
This is the part of the script that puts the email together and sends it.
global $strFrom,$strTo,$strSubject,$strEmailContent;
$To= $strFrom;
$Subject=$strSubject;
$Body=$strEmailContent;
mail($To,$Subject,$Body);
when I tried putting in
global $strFrom,$strTo,$strSubject,$strEmailContent;
$From = $strTo;
$To= $strFrom;
$Subject=$strSubject;
$Body=$strEmailContent;
mail($From,$To,$subject,$Body);
The email would be sent to me instead of the person and the persons email address would move to the subject.
What am I doing wrong?