What are the potential issues with using iso-8859-1 charset for email content?

Using iso-8859-1 charset for email content may lead to encoding issues, especially when sending emails with special characters or non-Latin characters. To solve this problem, it is recommended to use UTF-8 charset for email content, as it supports a wider range of characters and ensures better compatibility across different email clients.

// Set the charset to UTF-8 for email content
$headers = "Content-Type: text/html; charset=UTF-8\r\n";

// Send email using UTF-8 charset
mail($to, $subject, $message, $headers);