Thanks for the suggestion, Tim. Unfortunately, I get a 'connection refused' error on the line 'M = imaplib.IMAP4(server)'. It says "socket.error: (10061, 'Connection refused')". I've tried both the external IP adress and the internal one (10.0.0.2). I'm sure there's a way to get over this, isn't there?
One more question: can I avoid having (plain text) passwords in my code? I guess I could make a special account for this with a password known by everybody. Cheers, g "Tim Williams (gmail)" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] Lateral thinking ? === untested === import imaplib, time, sys f = open(msg_file) r = f.readlines() f.close() msg1 = ''.join(r) server = 'my.exchangeserver.com' # or IP address user = 'user' pw = 'pw' M = imaplib.IMAP4(server) M.sock.settimeout(120) M.login(user,pw)[1][0] M.select() M.append('INBOX',None ,time.time() , msg1) # Inbox or other folder name print "MESSAGE successfully saved" #M.close() Don't use close, deletes/purges items M.logout()[1][0] -- http://mail.python.org/mailman/listinfo/python-list