Python Smtp Authentication Example - Python

How to code python smtp authentication?

Snippet Code

Rate this page :
  [ 0 votes]

The SMTP protocol which includes a command line to ask a server an whether address is valid or invalid. VRFY is normally disabled to avoid spammers from finding legitimate email addresses, If it is enabled you can ask the server about an address and able to receive the status code with validity and users name.

import smtplib server = smtplib.SMTP(host='', port=587) print server server.set_debuglevel(True) # show communication with the server try: dhellmann_result = server.verify('dhellmann') notthere_result = server.verify('notthere') finally: server.quit() print 'dhellmann:', dhellmann_result print 'notthere :', notthere_result


Ask Questions

Ask Question