Utf8AddressEncoder.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /*
  3. * This file is part of SwiftMailer.
  4. * (c) 2018 Christian Schmidt
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * A UTF-8 email address encoder.
  11. *
  12. * Returns the email address verbatimly in UTF-8 as permitted by RFC 6531 and
  13. * RFC 6532. It supports addresses containing non-ASCII characters in both
  14. * local-part and domain (i.e. on both sides of @).
  15. *
  16. * This encoder must be used together with Swift_Transport_Esmtp_SmtpUtf8Handler
  17. * and requires that the outbound SMTP server supports the SMTPUTF8 extension.
  18. *
  19. * If your outbound SMTP server does not support SMTPUTF8, use
  20. * Swift_AddressEncoder_IdnAddressEncoder instead. This allows sending to email
  21. * addresses with non-ASCII characters in the domain, but not in local-part.
  22. *
  23. * @author Christian Schmidt
  24. */
  25. class Swift_AddressEncoder_Utf8AddressEncoder implements Swift_AddressEncoder
  26. {
  27. /**
  28. * Returns the address verbatimly.
  29. */
  30. public function encodeString(string $address): string
  31. {
  32. return $address;
  33. }
  34. }