Description
A full-featured library for parsing, validating, and rendering email addresses.
Description
A modern library for working with email addresses. This package can be used to validate user input or handle various flavors of addresses that appear in places such as mail messages.
Email addresses can be decoded, manipulated, then rendered back to text using the simple local-part@domain
format or the more complete syntax that allows for display names and comments.
Comprehensive documentation can be found in the Addy
module.
README.md
Addy: a modern library for working with email addresses
A full-featured library for parsing, validating, and rendering email addresses.
Decoding
Addy.decode "[email protected]"
-- Right (EmailAddr "[email protected]")
Addy.decode "我買@屋企.香港"
-- Right (EmailAddr "\25105\36023@\23627\20225.\39321\28207")
Addy.decode "Mary Smith <[email protected]> (hi there!)"
-- Right (EmailAddr "Mary Smith <[email protected]> (hi there!)")
Addy.decode "example@[127.0.0.1]"
-- Right (EmailAddr "example@[127.0.0.1]")
Encoding
Addy.encode address
-- "[email protected]"
Addy.decode "Mary Smith <[email protected]> (hi there!)"
& second Addy.encodeFull
-- Right "Mary Smith <[email protected]> (hi there!)"