I use the mailer in lots of areas, and usually in plain email we receive the emails with the senders email in the "From" field no problem.
When I set it up as HTML email all is fine (including the Reply-to field) except that the "From" field is our domain name:
From: here.com. If you reply-to the email the senders address does fill the "To:" Field.
here is code:
$to = "<ourselves@here.com>";
$subject = "Information request";
$msg = "<FONT face=Arial size=2>BUSINESS TYPE: <B>\t$type_realestate $type_smbiz $type_art $type_other</B><BR>";
$msg .= "DESCRIPTION: <B>\t$businessdescription</B><BR>";
$msg .= "NAME: <B>\t$firstname $lastname</B><BR>";
$msg .= "ADDRESS: <B>\t$address1</B><BR>";
$msg .= "<B>\t$address2</B><BR>";
$msg .= "CITY: <B>\t$city</B><BR>";
$msg .= "STATE: <B>\t$state";
$msg .= "</B> ZIP: <B>\t$zip</B><BR>";
$msg .= "COMPANY NAME: <B>\t$companyname</B><BR><BR>";
$msg .= "PHONE: <B>\t$phone</B>"; $msg .= " CELL: <B>\t$cellphone</B><BR>";
$msg .= "E-MAIL: <B>\t$email</B><BR>";
$msg .= "WEBSITE: <B>\t$url</B><BR><BR>";
$msg .= "How did you hear about NML?: <B>\t$source</B><BR>";
$msg .= "Additional information: <B>\t$AdditonalInfo</B><BR><BR>";
$msg .= "SOURCE: <B>\t$hostname</B></FONT><BR>";
$headers = "From: $firstname $lastname <$email>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Reply-To: $firstname $lastname <$email>\r\n";
$headers .= "X-Mailer: PHP / ".phpversion()."";
mail($to, $subject, $msg, $headers);
Just to clarify that the exact same code is used for plain email except for the headers: Mime.... and Content-type... and html code.
Since the reply-to works this is only an anoyance, but I would like to see the senders email identity in the from list instead of our domain name.
Is there a fix for this, our php version is 4.3.10
thanks