When using the PHP Mail() function you will find that the ‘from’ email address is often an unfriendly looking system email address sometimes even belonging to the root or system user, this can confuse your userbase as well as making it impossible for them to reply to any system messages that you send.
To make this change you first need to decide which email address you would like the from address to represent. This email address must exist on the server where your PHP Mail() function is being called, if the email address you choose does not exist, then your efforts will be wasted.
$result = mail(“firstname.lastname@example.org”, “subject”, “message”, “From: email@example.com\n”, “-firstname.lastname@example.org”);
Make sure that the email@example.com exists on the server, if it does not, this will not work.
If you have any problems simply contact the Helpdesk for further assistance,