Skip to content

Instantly share code, notes, and snippets.

@lxneng
Created July 27, 2011 11:54
Show Gist options
  • Save lxneng/1109205 to your computer and use it in GitHub Desktop.
Save lxneng/1109205 to your computer and use it in GitHub Desktop.
>>> import smtplib
>>> gmail_smtp='74.125.127.109'
>>> handle = smtplib.SMTP(gmail_smtp, 25)
>>> handle.ehlo()
(250, 'mx.google.com at your service, [58.246.22.38]\nSIZE 35882577\n8BITMIME\nS
TARTTLS\nENHANCEDSTATUSCODES')
>>> handle.starttls()
(220, '2.0.0 Ready to start TLS')
>>> handle.login('[email protected]', 'xxxxxxx')
(235, '2.7.0 Accepted')
>>> handle.sendmail('[email protected]', ['[email protected]'],'''From:lxneng@gmai
l.com\r\nTo:[email protected]\r\nSubject:Hello\r\nHahadkfjsflsdjflsd\r\n''')
{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment