Skip to content

Instantly share code, notes, and snippets.

@puentesarrin
Created August 26, 2013 02:21
Show Gist options
  • Save puentesarrin/6337614 to your computer and use it in GitHub Desktop.
Save puentesarrin/6337614 to your computer and use it in GitHub Desktop.
Bonzo sample
import tornado.ioloop
import email
from bonzo.smtpserver import SMTPServer
def receive_message(message):
print "New received message: "
print "From: " + message['from']
print "Subject: " + message['subject']
for line in email.iterators.body_line_iterator(message):
print line
SMTPServer(receive_message).listen(25)
tornado.ioloop.IOLoop.instance().start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment