- Edited
I don't understand what is the wrong
<?php
$to = "example@gmail.com";
$subject = "test";
$message = "
<html>
<head>
</head>
<body>
<h1>Hello world</h1>
</body>
</html>
";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers = "From: user@example.com>";
if (mail($to, $subject, $message, $headers)) {
echo "Email sent successfully";
} else {
echo "Email sending failed...";
}
?>