pip install inbox
python
import inbox
inbox = inbox.Inbox()
inbox.login('your-email@example.com', 'your-password', host='mail.example.com')
python
for message in inbox.fetch(limit=10):
print(message.subject)
python
inbox.send('recipient@example.com', subject='Hello', body='This is the body of the email.')
python
for message in inbox.fetch():
if message.subject == 'Spam':
message.delete()
elif message.subject == 'Important':
message.mark('Important')