What are some common pitfalls to avoid when working with MIME-encoded header lines in PHP?

One common pitfall to avoid when working with MIME-encoded header lines in PHP is forgetting to encode special characters properly. To ensure that special characters are encoded correctly, you can use the `mb_encode_mimeheader()` function in PHP.

// Example of encoding a header line with special characters using mb_encode_mimeheader()
$subject = 'Subject with special characters: äöü';
$subject_encoded = mb_encode_mimeheader($subject, 'UTF-8');

// Setting the encoded subject in the email headers
$headers = 'Subject: ' . $subject_encoded . "\r\n";

// Sending the email with the encoded header
mail('recipient@example.com', 'Test Email', 'This is a test email', $headers);