EmailClient
Email Client for reading and sending emails.
Install / Use
/learn @dros1986/EmailClientREADME
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
Related Skills
node-connect
350.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
