Skip to main content

Usage

This library is really easy to use:

from supermail import EmailClient

# define email client
gmail = EmailClient("your_email@gmail.com", "your_password")

# get all messages
messages = gmail.read() # if you need only unread, set parameter filter=['UNSEEN']

# for each message
for msg in messages:
	# get message info
	print(msg.subject())
	print(msg.message())
	print(msg.sender())
	# get attachments
	attachments = msg.attachments('./temp') # returns a list of filenames saved in specified dir

# send a message with attachments
gmail.send('recipient@gmail.com', 'Nice subject', 'Nice message', \
	cc='xxx@domain.it',
	attachments=['/path/to/pdf.pdf', '/path/to/image.png'])

Note

In order to use GMail, you need to log into your security page and:

  1. enable two-step verification
  2. right below, it will appear an option called App Password. Create a new one that you will be able to use with supermail.

Other email? No problem!

You can specify custom imap and smtp addresses and ports:

email_address = "your_email@gmail.com"
email_pwd = "your_password"
imap_server = "imap.gmail.com"
imap_port   = 993
smtp_server='smtp.gmail.com'
smtp_port=587

# define email client
gmail = EmailClient(email_address, email_pwd, imap_server, imap_port, smtp_server, smtp_port)

Install

You can install supermail from PyPI:

pip install supermail

or from the github page:

pip install git+https://github.com/dros1986/EmailClient.git

Metadata

Release files for supermail 1.3

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

Source distribution (sdist)

Source distribution for supermail 1.3
File Size Uploaded Provenance Actions
supermail-1.3.tar.gz 4.1 kB Without provenance Details for supermail-1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for supermail 1.3
File Interpreter ABI Platform Actions
supermail-1.3-py3-none-any.whl Python 3 none any Details for supermail-1.3-py3-none-any.whl

Total release size: 8.5 kB

Release files / supermail-1.3.tar.gz

Download URL supermail-1.3.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ab90eab88ce40e67ebf5c2d9413597f675396e82ba9ebb7cd2fe6e334060a780
BLAKE2b-256 checksum
How to use checksums
7ea9d940cdb2ff8a2a07c9eb7494c049c9ee1bb8908adff88de57a6cacd08a6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / supermail-1.3-py3-none-any.whl

Download URL supermail-1.3-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f88c589c83db4c5b078f2607b7bb5a0d7fa7db97e91e9c29e4c2f17e2ae11ad
BLAKE2b-256 checksum
How to use checksums
566e9e00d23363dc2b0e7566857fd2c8a3172cb54383ea845e7fd0ecd1ef7ab4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Security for supermail 1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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