email-validator
email-validator copied to clipboard
email validation is not working
email validation is not working
your validator returns true, for a random input [email protected] also
This is because this library is only checking if this could be a valid email. It checks if the format is right and returns true if it is. What you want to do is to check if a email is existing. You would need to get the last part of the email like this:
let email = "[email protected]";
let lastPartOfEmail = email.substring(email.indexOf("@"), email.length);
Then you would have to check if you are able to access the domain. You could build this from scratch but there are a lot of good libraries out there which will do the job better.
Now you know if a domain is valid or not.
Not you have to get the very first part of the email like this:
let email = "[email protected]";
let lastPartOfEmail = email.substring(0, email.indexOf("@")-1);
And now you would have to send another request. But: If you really want to have real email validation and not only based on if this could be an email you should try to solve this in your backend. If you're Python in your backend I personally would recommend this library: Python Email Validation
I hope I could help you
can you provide any javascript library? as reference, and not python library?
On Wed, 2 Mar, 2022, 11:45 pm Henrik, @.***> wrote:
This is because this library is only checking if this could be a valid email. It checks if the format is right and returns true if it is. What you want to do is to check if a email is existing. You would need to get the last part of the email like this:
let email = @.***";let lastPartOfEmail = email.substring(email.indexOf("@"), email.length);
Then you would have to check if you are able to access the domain. You could build this from scratch but there are a lot of good libraries out there which will do the job better.
Now you know if a domain is valid or not.
Not you have to get the very first part of the email like this:
let email = @.***";let lastPartOfEmail = email.substring(0, email.indexOf("@")-1);
And now you would have to send another request. But: If you really want to have real email validation and not only based on if this could be an email you should try to solve this in your backend. If you're Python in your backend I personally would recommend this library: Python Email Validation https://github.com/syrusakbary/validate_email
I hope I could help you
— Reply to this email directly, view it on GitHub https://github.com/manishsaraan/email-validator/issues/65#issuecomment-1057234812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN6P37WL2LYUNEWZTMA4OFTU56V5PANCNFSM5OK73OQA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
I don't know right now. You could take a look at this API https://verify-email.org/
i am looking for an open source code , since i can build my own service , other websites charge money. But i want to implement on my own with open source code
On Fri, 4 Mar, 2022, 2:46 pm Henrik, @.***> wrote:
I don't know right now. You could take a look at this API https://verify-email.org/
— Reply to this email directly, view it on GitHub https://github.com/manishsaraan/email-validator/issues/65#issuecomment-1058981948, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN6P37TJNGLXJSCU77D6SM3U6HIIVANCNFSM5OK73OQA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
Hi. In addition for @HenrikZabel answer. If you use it for back end (node or deno e.g.), you would try MX-record check. For more narrow checking, there's no way except for sending prompt emails to the addresses after all other checks. You can search for mx record validation on npm or wait when it will be implemented here as opt-in someday. It's on a roadmap.