How can the issue of Umlauts not displaying correctly in PHP mail be resolved without using a Mail class?

The issue of Umlauts not displaying correctly in PHP mail can be resolved by ensuring that the email content is encoded in UTF-8 before sending it. This can be done by setting the appropriate headers in the mail function to specify the content type as UTF-8.

$to = 'recipient@example.com';
$subject = 'Subject with Umlauts: ÄÖÜ';
$message = 'Message with Umlauts: ÄÖÜ';

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";

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