Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Python How to verify an email address
SUBMITTED BY:
alemotta
DATE:
March 28, 2017, 8:58 p.m.
FORMAT:
Text only
SIZE:
580 Bytes
Raw
Download
Tweet
HITS:
960
Go to comments
Report
Python How to verify an email address
The SMTP protocol includes a command to ask a server whether an address is valid.
Usually VRFY is disabled to prevent spammers from finding legitimate email
addresses,but if it is enabled you can ask the server about an address and
receive a status code indicating validity along with the user’s full name.
import smtplib
server = smtplib.SMTP('mail')
server.set_debuglevel(True) # show communication with the server
try:
userVerif = server.verify('dhellmann')
finally:
server.quit()
print 'User:', userVerif
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus