Not a big script to check for unread messages, when launched from a file it gives the following:
C:\check_mail>c:\Python33\python.exe check.py Traceback (most recent call last): File "check.py", line 1, in <module> import imaplib File "c:\Python33\lib\imaplib.py", line 25, in <module> import binascii, errno, random, re, socket, subprocess, sys, time, calendar File "c:\Python33\lib\socket.py", line 47, in <module> import _socket ImportError: DLL load failed: Не найден указанный модуль.
If everything is entered into the interpreter, then everything works out.
Listing:
import imaplib mail = imaplib.IMAP4_SSL('nameserver') mail.login('login', 'password') mail.select('INBOX') num = len(mail.search(None, 'UNSEEN')[1][0].split()) print (num)