dlvr

Email sending for humans
Download

dlvr Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Bernhard Maeser
  • Publisher web site:
  • https://github.com/bmaeser/

dlvr Tags


dlvr Description

dlvr is a tool that provides email sending for humans.Installationwith pip as easy as: pip install dlvror checkout the latest version from github: git clone https://github.com/bmaeser/dlvr.git cd dlvr python setup.py installQuickstartopen a connection to a server:>>> from dlvr import SMTPServer>>> s = SMTPServer()create a email:>>> from dlvr import Message>>> m = Message('bob@example.com', , 'testsubject', 'testbody')send the email:>>> s.connect()>>> s.send(m)>>> s.disconnect()Full examplefrom dlvr import SMTPServer, Messageserver = SMTPServer(host="smtp.googlemail.com", port='587', auth_user='MYUSERNAME', auth_pass='MYPASSWOR', tls=True)## host (optional): defaults to localhost## port (optional): defaults to 25## auth_user (optional): your usernamer## auth_pass (optional): your passwort## tls (optional): encrypt the session defaults to Falsetext = 'here is you link: http://www.google.com'subject = 'the link you asked for'html = """\< html > < head >< /head > < body > < p >Hi!< br > Here is the < a href="http://www.google.com" >link to google< /a > you wanted. < /p > < /body >< /html >"""message = Message('bob@example.com', , subject, text, alternatives=)## constructor arguments:## from_email: required, the senders email## to: required, a list of recipients## subject: required, the emails subject## text_message (optional): the text representation of the email body## cc (optional): a list of the carbon-copy recipients## bcc (optional): a list of blind-carbon-copy recipients## attachments (optional): a list of attachments, and the mimetype to use eg:## attachments = ## alternatives (optional): a list of alternative representation of the email body## and the mimetype to use## charset (optional): the charset/encoding to use for text_message, defaults to utf-8## message functions:# attach_alternative(content, 'mimetype')# where mimetype is optional und defaults to 'text/html'# attach_file('/path/to/file', 'mimetype')# where mimetype is opional and is guessed if not providedserver.connect()server.send(message)## send another message with the same open connection ...server.disconnect()## or shorthand if you only send one message:server.send_email(message)Contributepull-request please and/or create a issue on githubProduct's homepage


dlvr Related Software