Skip to main content

An email client for reading and sending emails.

Project description

Installation via pip

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

Usage

This library is really easy to use:

from supermail import EmailClient

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)

# get all messages
messages = gmail.read() # if you need only unread, set 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
	print('---')

# 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 EmailClient.

Less secure apps. no longer works.

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.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supermail-1.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file supermail-1.2.tar.gz.

File metadata

  • Download URL: supermail-1.2.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

Hashes for supermail-1.2.tar.gz
Algorithm Hash digest
SHA256 cd68ac5fd17f8b5a115ed64a3ec437e57be5aea1a1a974a73a8292db0416816f
MD5 33d611a71a13fb80fe3070dfb029c33f
BLAKE2b-256 787a859df7b887e1c8936108956b29f2b58244ebc9c400a3e54a8cdbbb9dc7d2

See more details on using hashes here.

File details

Details for the file supermail-1.2-py3-none-any.whl.

File metadata

  • Download URL: supermail-1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for supermail-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3113253b44729b4cb384b9c8ba339d63bf046503d8149f6d08a6368953e60d70
MD5 f092a0f7386515e0fee746dad64a79cb
BLAKE2b-256 40cc87a811e45a3b791b584db31f3c86d81224495c555ffe92139e552dbd4aa5

See more details on using hashes here.

Supported by

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