An email client for reading and sending emails.
Project description
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:
- enable two-step verification
- 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
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
supermail-1.3.tar.gz
(4.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file supermail-1.3.tar.gz.
File metadata
- Download URL: supermail-1.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab90eab88ce40e67ebf5c2d9413597f675396e82ba9ebb7cd2fe6e334060a780
|
|
| MD5 |
f660d9a3d2adf6e134fb28bb6782c0b0
|
|
| BLAKE2b-256 |
7ea9d940cdb2ff8a2a07c9eb7494c049c9ee1bb8908adff88de57a6cacd08a6f
|
File details
Details for the file supermail-1.3-py3-none-any.whl.
File metadata
- Download URL: supermail-1.3-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f88c589c83db4c5b078f2607b7bb5a0d7fa7db97e91e9c29e4c2f17e2ae11ad
|
|
| MD5 |
6f7c0e378de75bff49f1eed25ec9a885
|
|
| BLAKE2b-256 |
566e9e00d23363dc2b0e7566857fd2c8a3172cb54383ea845e7fd0ecd1ef7ab4
|