Are there any specific PHP functions or libraries that can assist in handling IDN-encoded email addresses in Swiftmailer?

When handling IDN-encoded email addresses in Swiftmailer, it is important to use the `idn_to_ascii()` function to convert the internationalized domain names (IDNs) to ASCII before sending the email. This ensures that the email addresses are properly encoded and can be processed correctly by the email server.

$email = 'john.doe@xn--bcher-kva.example'; // IDN-encoded email address
$ascii_email = idn_to_ascii($email);

$message = (new Swift_Message())
    ->setSubject('Hello')
    ->setFrom(['sender@example.com' => 'Sender'])
    ->setTo([$ascii_email => 'Recipient'])
    ->setBody('This is a test email.');

// Send the email
$mailer->send($message);