Skip to main content

encode_email_address

Function encode_email_address 

Source
pub fn encode_email_address(addr: &str) -> String
Expand description

Encode an email address for use in email headers.

Rules:

  • If the display name contains non-ASCII chars → RFC 2047 encode it
  • If the display name contains RFC 822 special chars (like .) → quote it
  • Otherwise → use as-is