Rolly Maulana Awangga :: Catatan Ngoprek IT

Pakar dan Awam sama saja, sama sama belajar

Tag Archives: github

Python Outlook(Microsoft email service) IMAP4 Library

Python Library to read email from live, hotmail, outlook or any microsoft email service, just dowload to yout python script folder. This library using Imaplib python to read email with IMAP protocol.

go here : https://github.com/awangga/outlook

Example

To get latest Unread Message in inbox :

import outlook
mail = outlook.Outlook()
mail.login('emailaccount@live.com','yourpassword')
mail.inbox()
print mail.unread()

To get latest Unread Message in Junk :

import outlook
mail = outlook.Outlook()
mail.login('emailaccount@live.com','yourpassword')
mail.junk()
print mail.unread()

Retrive email element :

print mail.mailbody()
print mail.mailsubject()
print mail.mailfrom()
print mail.mailto()
%d blogger menyukai ini: