What are common issues when sending emails with PHP, especially when dealing with special characters like umlauts?

When sending emails with PHP, common issues arise when dealing with special characters like umlauts due to encoding problems. To solve this, you can use the `mb_encode_mimeheader()` function to properly encode the subject line of the email.

$subject = 'Subject with ümläuts';
$encoded_subject = mb_encode_mimeheader($subject, 'UTF-8');
$headers = 'From: sender@example.com' . "\r\n" .
           'Reply-To: sender@example.com' . "\r\n" .
           'MIME-Version: 1.0' . "\r\n" .
           'Content-type: text/html; charset=utf-8' . "\r\n" .
           'Content-Transfer-Encoding: 8bit' . "\r\n" .
           'X-Mailer: PHP/' . phpversion();

mail('recipient@example.com', $encoded_subject, 'Email body', $headers);