What are the potential issues when sending emails with IDN-encoded domains using Swiftmailer?

When sending emails with IDN-encoded domains using Swiftmailer, potential issues may arise due to encoding and decoding problems. To solve this, you can use the `idn_to_ascii` and `idn_to_utf8` functions to convert the domain name to ASCII before sending the email.

// Convert IDN-encoded domain to ASCII before sending email
$domain = 'xn--bcher-kva.example.com'; // IDN-encoded domain
$ascii_domain = idn_to_ascii($domain);

// Use the ASCII domain in the email
$message = (new Swift_Message('Hello'))
    ->setFrom(['sender@example.com' => 'Sender'])
    ->setTo(['recipient@example.com' => 'Recipient'])
    ->setBody('This is a test email with IDN-encoded domain: ' . $ascii_domain);

// Send email using Swiftmailer
$transport = new Swift_SmtpTransport('localhost', 25);
$mailer = new Swift_Mailer($transport);
$result = $mailer->send($message);