Skip to main content

JT_Gmail

This is a simple interface for programmatically sending emails using the Gmail API.

pip install JT_Gmail

To get started you must create a project and enable the Gmail API, create OAuth2 credentials and download them in a json file.

Before you can use this module for the first time, you must run:

import JT_Gmail as gmail

gmail.GetToken(scopes=['scope1', 'scope2'], email_address='user@gmail.com', cred_path="path_to_your_credentials.json")

Supply the scopes you plan on using as *args. A list of all the scopes can be found here. Each function also includes the required scopes in its docstring.

This will prompt for authentication and generate the proper token to use the scopes you supplied. The token and credentials are saved for later use, so you might only have to run that line once. As you perform actions, if they need new permissions, they will be requested. Authentication will be required for each gmail user you wish to use.

To send emails, it's as easy as:

import JT_Gmail as gmail

with open("email.html") as file:
    gmail.SendHTMLEmail(
        sender='sender@gmail.com', 
        to="recipient@some.website", 
        subject="Example Email", 
        message_html=file.read()
)

This was base heavily on code snippets supplied by Google.

Release files for JT-Gmail 0.0.24

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for JT-Gmail 0.0.24
File Size Uploaded
JT_Gmail-0.0.24.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for JT-Gmail 0.0.24
File Interpreter ABI Platform
JT_Gmail-0.0.24-py3-none-any.whl Python 3 none any Details

Total release size: 16.8 kB

Release files / JT_Gmail-0.0.24.tar.gz

Download URL JT_Gmail-0.0.24.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9857d8fe71cb6d616c2d88c4774b0384465e59cf6c8289924c1ecb35cdce3ed6
BLAKE2b-256 checksum
How to use checksums
a6972cdbdfa5ca2990413f6d9e7cd956485aa7769b73bedfe545b4b3d45671a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4

Release files / JT_Gmail-0.0.24-py3-none-any.whl

Download URL JT_Gmail-0.0.24-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8151966f807670fc3b162391cfa9d4e37e3e9d2c8868c63f6e551882a4a9150
BLAKE2b-256 checksum
How to use checksums
86570961d2c0e6bb22fd4e98089f6ba1c680b183655fcc4576fc444f9213ef27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.0.24 This release

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page