I am using a mail function to send html to an email address, but the From name and email address aren t showing up. This is my code:
$name = $_POST[ name ];
$mailTo = name@email.com ;
$subject = Message from . $_POST[ name ];
$message =
<html>
<head>
<title>HTML email</title>
</head>
<body>
<p><b>Name:</b> . $_POST[ name ] . </p>
<p><b>Email:</b> . $_POST[ email ] . </p>
<p><b>Message:</b> . $_POST[ mainmessage ] . </p>
</body>
</html> ;
$headers = MIME-Version: 1.0 . "
";
$headers .= Content-type: text/html; charset=iso-8859-1 . "
";
$headers .= From: Postmaster <some@body.com> ;
mail($mailTo, $subject, $message, $headers);
I would expect the email to show up as being from Postmaster at the email address some@body.com, but it is showing up as coming from ideapale@box486.bluehost.com, which is my hosting provider.
What did I not set up correctly?