I am sending email using Mail successfully with the following exception:
The "from" address defaults to the email address for the site administrator.
Here is the code I am using:
$mail_to = $rsRecipients->Fields('emailAddy');
$mail_subject = "Update";
$mail_body = stripslashes(strip_tags($txtMessage));
$from_name = "FromMe";
$from_email = "me@whereIam.com";
$headers = "From: $from_name<$from_email>\n";
$headers .= "Reply-To: <$from_email>\n";
if ( mail($mail_to, $mail_subject, $mail_body, $headers) ) {
$emailStatus = "You message has been successfully sent. A copy of it is shown to the right.";
}
else { $emailStatus = "There was a problem sending your email, please return to the previous page and try again.";
$emailStatus .= "If this problem persists, please contact your system administrator.";
}
I have tried several variations, but the mail From still comes out as From: the siteadmin at thedomain.com
TIA!