Check if an email address exists without sending any email, written in Rust. Comes with a ⚙️ HTTP backend.
Rust emailemail-validationemail-validation-apiemail-verificationemail-verification-apiemail-verifierhacktoberfest
Fix bug debug message not showing
Amaury Martiny5e242adf6e9d
diff --git a/src/smtp.rs b/src/smtp.rsindex d3c07ad8..4183d0b2 100644--- a/src/smtp.rs+++ b/src/smtp.rs@@ -66,21 +66,24 @@ pub fn email_exists(from: &str, to: &str, host: &Name, port: u16) -> Result<boolEmailAddress::new(to.to_string()).unwrap(),vec![],)) {- Ok(response) => {- if let Some(message) = response.first_line() {+ Ok(response) => match response.first_line() {+ Some(message) => {// 250 2.1.0 Sender e-mail address ok.if message.contains("2.1.5") {- return Ok(true);+ Ok(true)+ } else {+ Err(())}}- Err(())- }+ _ => Err(()),+ },Err(err) => {// 550 5.1.1 Mailbox does not exist.if err.to_string().contains("5.1.1") {- return Ok(false);+ Ok(false)+ } else {+ Err(())}- Err(())}};