[python-win32] How to get mails from Exchange Server

Antony Joseph antonyjoseph89 at gmail.com
Thu Dec 27 10:36:42 CET 2007


hi all,

I can read my mails  locally from my outlook,
I want to read my mail directly from Exchange server , How can i do that?
Any Help/link will be usefull to me .

my code

import win32com.client
session = win32com.client.Dispatch("MAPI.Session")
session.Logon()
inbox = session.Inbox
collmsg = inbox.Messages
print  collmsg
msg = collmsg.GetFirst()
while msg:
    print "subject: ", msg.subject
    msg = collmsg.GetNext()
session.Logoff()

Thanks

Antony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20071227/c1155d81/attachment.htm 


More information about the python-win32 mailing list