headers in PHP mail function
Posted on 2011-02-12
I am using PHP mail function. All is going well except the "FROM: " is not giving the correct email address. The header information is coded as follows:
$headers = "From: DONOTREPLY@mysite.org\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
By the way, the email is in HTML format.
What I get in the From field is "From: firstname.lastname@example.org". What I want is "From: DONOTREPLY@mysite.com".
The idea is that the user will ask a question from the site and the answer is emailed to the user using PHP email. However, the userid used in from is supposed to be outgoing mailbox only. Since I do not know how to setup outgoing mailbox, what I am doing is using an email address that does not exist. In this case even if someone wants to reply to the email, they will get an error my their email system.
<<< Ali >>>