Search

Lib.rs

› Email
#syntax #no-alloc

no-std email-validator

An email syntax validator

Owned by Shadowcat650.

  • Install
  • API reference
  • GitHub repo (shadowcat650)

1 unstable release

Uses new Rust 2024

0.1.0 Dec 11, 2025

#290 in Email

CC0 license

18KB
393 lines

Email Validator

An open-source library that provides a simple way to validate the structure of an email based on RFC 3696. This project does not ensure the email is actually valid—just that it could be valid. This is useful for instances where you want to validate user email input to ensure it correct.

Usage

use email_validator::validate_email;

fn main() {
    let is_valid = validate_email("test@example.co");
    assert_eq!(is_valid, true);
    
    let is_valid = validate_email("test@example");
    assert_eq!(is_valid, false);
}

Contributing

Note that this tool is not perfect and can allow invalid emails or may deny valid ones (very rarely). To see the types of emails this tool allows, view the tests module. If you notice any errors, please create a pull request or issue on GitHub.

If you would like to request a feature, please file an issue on GitHub before creating a pull request to ensure it will be accepted.

No runtime deps

Features

  • std
See also: cssparser, onig, two-face, choose, tishlang, duplicate, swc_ecma_transforms_typescript, vibe-style, clerk-rs, fast_chemail

Lib.rs is an unofficial list of Rust/Cargo crates, created by kornelski. It contains data from multiple sources, including heuristics, and manually curated data. Content of this page is not necessarily endorsed by the authors of the crate. This site is not affiliated with nor endorsed by the Rust Project. If something is missing or incorrect, please file a bug.