PHP code example of ossinkine / swiftmailer-punycode-plugin

1. Go to this page and download the library: Download ossinkine/swiftmailer-punycode-plugin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ossinkine / swiftmailer-punycode-plugin example snippets


use Ossinkine\Swift\Plugin\PunycodePlugin;

// Create the Mailer using any Transport
$mailer = new Swift_Mailer(
  new Swift_SmtpTransport('smtp.example.org', 25)
);

// Register the plugin
$mailer->registerPlugin(new PunycodePlugin());

// Create a message with Unicode-encoded receiver address
$message = (new Swift_Message())
  ->setTo(['receiver@bücher.tld'])
;
// Send the message
$mailer->send($message);