I have a code where emails are being sent to the given ID using smtp and if the mail id does not exists then mail wont get delivered. So, I want to capture the email ID's if they do not exist. Can this be done by python script?
Asked
Active
Viewed 275 times
1 Answers
1
Yes. You can use a package called validate_email. The following code returns a boolean:
validate_email('example@example.com')

Oyster773
- 375
- 1
- 10
-
it gives me this error- "'module' object is not callable" – Komal Madamwar Nov 26 '17 at 16:38
-
@KomalMadamwar - Because you're probably doing exactly what the error is telling you. You're trying to call a module object. Make sure you do this as your import: `from validate_email import validate_email` – Oyster773 Nov 26 '17 at 23:59
-
Ohh yes!! I got that corrected now. thanks :-) I was just adding import validate_email, that was the reason for this error – Komal Madamwar Nov 29 '17 at 06:40
-
Please select this answer as the correct one then! – Oyster773 Nov 29 '17 at 19:43