import mailboxmailboxname = "/tmp/mymailbox"mbox = mailbox.UnixMailbox(open(mailboxname))msgcounter = 0while 1: mailmsg = mbox.next() if not mailmsg: break msgcounter = msgcounter + 1 messagebody = mailmsg.fp.read() print messagebodyprintprint "The message counter is %d" % (msgcounter)
Name (required)
email (will not be published) (required)
Website