pip install inbox.py
python
import inbox
imap_host = 'mail.example.com'
imap_port = 993
imap_username = 'your_username'
imap_password = 'your_password'
box = inbox.Inbox(imap_host, imap_port, imap_username, imap_password)
python
for msg in box:
")
python
import inbox
smtp_host = 'smtp.example.com'
smtp_port = 587
smtp_username = 'your_username'
smtp_password = 'your_password'
box = inbox.Outbox(smtp_host, smtp_port, smtp_username, smtp_password)
box.create_message()
box.set_sender('your_email@example.com')
box.set_recipients(['recipient1@example.com', 'recipient2@example.com'])
box.set_subject('This is the subject')
box.set_body('This is the body of the email')
box.send_message()
python
box.close()