use-email
Feature-gated facade crate for RustUse email primitives.
Experimental
use-email is experimental while the workspace remains below 0.3.0.
Example
# #[cfg(all(feature = "address", feature = "message", feature = "mailto"))]
# fn main() -> Result<(), Box<dyn std::error::Error>> {
use use_email::address::Mailbox;
use use_email::message::EmailMessage;
use use_email::mailto::MailtoBuilder;
let mailbox = Mailbox::new(Some("Jane Doe"), "jane@example.com")?;
let message = EmailMessage::plain_text("Hello", "A short note.");
let uri = MailtoBuilder::new().to("jane@example.com")?.subject("Hello").build();
assert_eq!(mailbox.to_string(), "\"Jane Doe\" <jane@example.com>");
assert_eq!(message.subject(), Some("Hello"));
assert_eq!(uri.to_string(), "mailto:jane@example.com?subject=Hello");
# Ok(())
# }
# #[cfg(not(all(feature = "address", feature = "message", feature = "mailto")))]
# fn main() {}
Scope
- Address, header, message, envelope, message identity, MIME,
mailto:, SMTP vocabulary, and authentication metadata modules.
- Thin facade modules over focused crates.
Non-goals
- Sending, receiving, storing, or templating mail.
- Provider SDKs or framework abstractions.
- Network, DNS, TLS, or async runtime behavior.
License
Licensed under either Apache-2.0 or MIT.