Giter Club home page Giter Club logo

gmail-sender's Introduction

        
    gmail
    -----

    The 'gmail' module provides a simple wrapper around the smtplib/email
    modules to provide an easy programmatic interface for sending email using
    the GMail SMTP service.

    The module provides the following classes:

    GMail           - Basic interface to GMail SMTP service 
    GMailWorker     - Background worker to send messages asynchronously 
                      (uses multiprocessing module)
    GMailHandler    - GMail handler for logging framework
    Message         - Wrapper around email.Message class simplifying
                      creation of email message objects

    The module also provides a cli interface to send email if run directly
    (python -mgmail.cli)
    
    Basic usage:

    >>> gmail = GMail('A.User <[email protected]>','password')
    >>> msg = Message('Test Message',to='xyz <[email protected]>',text='Hello')
    >>> gmail.send(msg)

    Note: You will need to setup an application-specific password rather
          than using your account-password - see:
          
            https://support.google.com/mail/?p=InvalidSecondFactor
            https://security.google.com/settings/security/apppasswords

    The Message class also provides support to simply generate html email and
    add attachments.

    >>> msg = Message('Test Message',to='[email protected]',text="Hello",html="<b>Hello</b>",attachments=['img.jpg'])

    In Python3 messages will be unicode (utf8) encoded by default unless the
    text is passed a a bytes object (the inverse is true in Python 2)

    For examples of use see cli.py and test_gmail.py/test_message.py

    Changelog:

        *   0.1     2012-10-17  Initial Release
        *   0.2     2012-10-18  Restructure module
        *   0.3     2012-12-28  Fix logging/worker 
        *   0.3.1   2012-12-28  CLI attachment mime-type fix
        *   0.4     2013-08-24  Allow user to specify 'From' and 'Reply-To' header by passing 'sender'
                                (Pull from from https://github.com/Kami - thanks)
        *   0.5     2014-02-12  Move _gmail_worker to module function to fix 
                                multiprocessor problem on win32 
                                (Fix from [email protected] - thanks)
        *   0.6.1   2016-09-25  Python 3 support
        *   0.6.2   2016-12-12  Fix to Python 3 exception handling
        *   0.6.3   2017-08-07  Try to handle non-ascii filenames
                                Fix for exception on `__del__` Method Invocation
                                (thanks to https://github.com/theonewolf for fix/pull request)

    License:

        *   BSD

    Author:

        *   Paul Chakravarti ([email protected])

gmail-sender's People

Contributors

paulc avatar kami avatar theonewolf avatar tanmayb123 avatar

Watchers

kijeong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.