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 = '[email protected]';
$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' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Postmaster <[email protected]>';
mail($mailTo, $subject, $message, $headers);
I would expect the email to show up as being from Postmaster at the email address [email protected], but it is showing up as coming from [email protected], which is my hosting provider.
What did I not set up correctly?