Skip to content

🗿 Swiftmailer plugin to convert domain in email addresses to punycode

License

Notifications You must be signed in to change notification settings

ossinkine/swiftmailer-punycode-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swiftmailer Punycode Plugin

Build Status

Swiftmailer plugin to convert domain in email addresses to punycode.

Installation

composer require ossinkine/swiftmailer-punycode-plugin

Usage

Create and register a plugin instance when you setup a Swift_Mailer instance.

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());

Now you can send an email to an address with Unicode-encoded domain.

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

Usage with Symfony

Just register a service with a swiftmailer.default.plugin tag in your services.yml.

Ossinkine\Swift\Plugin\PunycodePlugin:
    tags: [swiftmailer.default.plugin]

License

Swiftmailer Punycode Plugin is licensed under the MIT license.

About

🗿 Swiftmailer plugin to convert domain in email addresses to punycode

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages