What are the steps to send HTML emails using PHP instead of plain text?

When sending emails using PHP, by default, the emails are sent as plain text. To send HTML emails instead, you need to set the appropriate headers in the PHP `mail()` function to indicate that the content type is HTML. This can be done by adding the "Content-Type" and "MIME-Version" headers to the email.

$to = 'recipient@example.com';
$subject = 'HTML Email Test';
$message = '<html><body><h1>Hello, this is an HTML email!</h1></body></html>';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

mail($to, $subject, $message, $headers);