What steps can be taken to ensure proper character encoding and display of Umlauts in emails generated by PHP forms across different email clients?

When sending emails with Umlauts from PHP forms, it's important to ensure that the character encoding is set to UTF-8 to properly display special characters across different email clients. This can be achieved by setting the appropriate headers in the PHP script that sends the email.

<?php
// Set the content type and character encoding
$headers = "Content-Type: text/plain; charset=UTF-8\r\n";
$headers .= "Content-Transfer-Encoding: 8bit\r\n";

// Send the email with the specified headers
mail($to, $subject, $message, $headers);
?>