Skip to main content

Crate use_email_address

Crate use_email_address 

Source
Expand description

§use-email-address

Email address and mailbox primitives for RustUse.

§Experimental

use-email-address is experimental while use-email remains below 0.3.0.

§Example

use use_email_address::{AddressValidationMode, EmailAddress, Mailbox};

let address = EmailAddress::new_with_mode("jane@example.com", AddressValidationMode::Practical)?;
let mailbox = Mailbox::new(Some("Jane Doe"), address.to_string())?;

assert_eq!(address.local_part().as_str(), "jane");
assert_eq!(address.domain_part().as_str(), "example.com");
assert_eq!(mailbox.to_string(), "\"Jane Doe\" <jane@example.com>");

§Scope

  • Address, local-part, domain, display-name, mailbox, mailbox-list, and address-group wrappers.
  • Practical, strict ASCII, and internationalized validation modes.
  • Conservative formatting and parsing helpers.

§Non-goals

  • Complete RFC 5322 or RFC 6532 parsing.
  • DNS lookup or deliverability checks.
  • Provider-specific address policy.

§License

Licensed under either Apache-2.0 or MIT.

Structs§

AddressGroup
A named group of visible mailboxes.
DisplayName
Human-readable display name for a mailbox.
DomainPart
Email domain-part text.
EmailAddress
Validated email address text split into local and domain parts.
LocalPart
Email local-part text.
Mailbox
A visible mailbox: optional display name plus email address.
MailboxList
A comma-rendered list of visible mailboxes.

Enums§

AddressValidationError
Error returned when an email address primitive fails validation.
AddressValidationMode
Validation profile for address-like primitives.