Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 969 Bytes

README.md

File metadata and controls

39 lines (28 loc) · 969 Bytes

mailpy

Python IMAP and SMTP Wrapper

Setup

To use mailpy with Gmail you will need to create a App Password for your Google Account

Installation

python3 -m pip install mailpy  

or

git clone https://github.com/Y4hL/mailpy.git && python3 setup.py install  

Usage

import mailpy

# Example with GMail
IMAP_ADDRESS = ('imap.google.com', 993)
SMTP_ADDRESS = ('smtp.google.com', 465)
server = mailpy.Server(IMAP_ADDRESS, SMTP_ADDRESS)
server.login('username', 'password')
server.select_mailbox('INBOX')
for mail_id in server.get_mail_ids():
    mail = server.get_mail(mail_id)
    print(mail['Subject'])

Contributing

Before creating an issue, please ensure that it hasn't already been reported/suggested.
See the contribution guide if you'd like to submit a PR.