Skip to main content

Gmail client

Project description

Description

High-level interface for sending email through googlemail.

Usage

Create conf.py and fill in your email and password credentials. Ex:

email = 'your.email@gmail.com'
password = 'your.pass'   

Create googlemail object:

gmail = Gmail(email, password)

Start the server and login

gmail.start_server()
gmail.login()

Create a simple template dictionary with the email header and body

mail_template = {
    'from': 'fromsender@gmail.com',
    'to': 'tosender@gmail.com',
    'subject':  'Cool subject email',
    'body': """
    HTML template or the like
    """
}

Send the message

gmail.send_msg(mail_template)

Testing

To run the tests you need to configure the sender username, password, and recipient email

$ export GOOGLEMAIL_EMAIL=<YOUR SENDER EMAIL>
$ export GOOGLEMAIL_PASSWORD=<YOUR SENDER PASSWORD>

$ export GOOGLEMAIL_TESTEMAIL=<YOUR TEST RECIPIENT EMAIL>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

googlemail-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

googlemail-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file googlemail-0.1.0.tar.gz.

File metadata

  • Download URL: googlemail-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for googlemail-0.1.0.tar.gz
Algorithm Hash digest
SHA256 05a7deb27b54f477fdc4fd8ba18703e38f5f7f6d153f441e481acec525401bd4
MD5 2fffba38b6ee7c69eb39686a95b4b4aa
BLAKE2b-256 58186328a9101bbb1c86565a467ab50935c47bd9891fdfd25e249f201a9c6ec5

See more details on using hashes here.

File details

Details for the file googlemail-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: googlemail-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for googlemail-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60f9361560c50225dee3d29276131da4f57b69134467cc8bcdf3bc391ba3b074
MD5 1d7f2033587bab7a85183d1a1cf8158b
BLAKE2b-256 ee56bee5c366845466955b866ee56f1079ffd0b0b387d9c8c04e407f096b8ec6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page