Skip to content

Instantly share code, notes, and snippets.

@sa2ajj
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sa2ajj/13f86d3437eb9109af8c to your computer and use it in GitHub Desktop.
Save sa2ajj/13f86d3437eb9109af8c to your computer and use it in GitHub Desktop.
Simple test plain SMTP + STARTTLS + AUTH works
#! /usr/bin/python -tt
from smtplib import SMTP
from getpass import getpass
def main():
"""
entry point
"""
server = SMTP(HOST)
server.starttls()
print server.ehlo(OTHER_HOST)
user = raw_input('user: ')
password = getpass('password: ')
print server.login(user, password)
server.close()
if __name__ == '__main__':
main()
# vim:ts=4:sw=4:et:tw=80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment