Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow verifying multiple emails in one SMTP connection #65

Open
amaury1093 opened this issue Sep 30, 2019 · 7 comments
Open

Allow verifying multiple emails in one SMTP connection #65

amaury1093 opened this issue Sep 30, 2019 · 7 comments
Assignees

Comments

@amaury1093
Copy link
Member

amaury1093 commented Sep 30, 2019

Assume we get as input to the main function something like a Vec<&str>, with all emails in the same domain. Is it possible to verify multiple emails on that same domain?

In this case, we should just call email_deliverable multiple times, using the same smtp_client, to avoid too many connections.

https://github.com/amaurymartiny/check_if_email_exists/blob/f8acd1ee61a3f7fefe2b1af93d744bb3a9d9095a/core/src/smtp.rs#L219-L239

@redoxeon
Copy link

redoxeon commented Oct 1, 2019

I'm really new to rust, but I could maybe try this. I'm not quite understanding step 1 though. Is it already calling email_deliverable multiple times whenever it checks dilverability?

@amaury1093
Copy link
Member Author

Nice! That'd be great.

Is it already calling email_deliverable multiple times whenever it checks dilverability?

Yes exactly, it just means, at line 229 above, call the email_deliverable function multiple times. But we shouldn't create a new connection each time, just use the same smtp_client.

So step 1 is actually probably 90% of this issue, I'm not sure dividing it into 2 steps was actually clever 😄

@WaffleLapkin
Copy link

@redoxeon Have you done some progress implementing this yet?

Can I try to implement this feature?

Also, @amaurymartiny , do I understand you right, that all API that accepts params like to_email: &str, from_email: &str must now accept something like Vec<(&str, &str)>?

@amaury1093
Copy link
Member Author

amaury1093 commented Oct 11, 2019

that all API that accepts params like to_email: &str, from_email: &str must now accept something like Vec<(&str, &str)>

I was initially thinking to_email: Vec<&str>, from_email: &str (from_email is not really important), but yeah, Vec<(&str, &str)> is even more customizable.

@redoxeon
Copy link

@WaffleLapkin I haven't gotten very far on this at all, so if you beat me at it, that'd be totally fine :)

@3sigma-devops
Copy link

hey,did you get around to implementing it?

@amaury1093
Copy link
Member Author

Nope, never implemented this. I guess this is a good hacktoberfest issue, if you want to tackle it.

@amaury1093 amaury1093 changed the title Allow verifying multiple emails at once Allow verifying multiple emails in one SMTP connection Aug 15, 2022
amaury1093 added a commit that referenced this issue Aug 15, 2022
BREAKING CHANGE:

The library's main function `check_email`'s argument `CheckEmailInput` nows takes a single `to_email` field, instead of a `to_emails: Vec<String>`

```diff
pub struct CheckEmailInput {
- pub to_emails: Vec<String>,
+ pub to_email: String,
  // --snip--
}
```

This effectively makes the public API more similar to the v0.7.* series. I'm still thinking about how to best verify multiple emails in one SMTP connection, but it most likely will be a new function with a different API. Follow [issue #65](#65) for more info.
coinbest90726 added a commit to coinbest90726/check-email that referenced this issue Apr 26, 2024
BREAKING CHANGE:

The library's main function `check_email`'s argument `CheckEmailInput` nows takes a single `to_email` field, instead of a `to_emails: Vec<String>`

```diff
pub struct CheckEmailInput {
- pub to_emails: Vec<String>,
+ pub to_email: String,
  // --snip--
}
```

This effectively makes the public API more similar to the v0.7.* series. I'm still thinking about how to best verify multiple emails in one SMTP connection, but it most likely will be a new function with a different API. Follow [issue #65](reacherhq/check-if-email-exists#65) for more info.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants