[pywin32-checkins] pywin32/com/win32comext/mapi/demos mapisend.py,1.1,1.2
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
|
From: Mark H. <mha...@us...> - 2004-09-24 04:04:02
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/mapi/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28485 Modified Files: mapisend.py Log Message: New version from Stephen Emslie. Index: mapisend.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/demos/mapisend.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mapisend.py 20 Aug 2004 23:42:32 -0000 1.1 --- mapisend.py 24 Sep 2004 04:03:52 -0000 1.2 *************** *** 4,8 **** # this was based on Jason Hattingh's C++ code at http://www.codeproject.com/internet/mapadmin.asp ! # written by David Fraser <da...@sj...> and Stephen Emslie <ste...@sj...> # you can test this by changing the variables at the bottom and running from the command line --- 4,8 ---- # this was based on Jason Hattingh's C++ code at http://www.codeproject.com/internet/mapadmin.asp ! # written by David Fraser <davidf at sjsoft.com> and Stephen Emslie <stephene at sjsoft.com> # you can test this by changing the variables at the bottom and running from the command line *************** *** 26,36 **** messagestorestable.SetColumns((mapitags.PR_ENTRYID, mapitags.PR_DISPLAY_NAME_A, mapitags.PR_DEFAULT_STORE),0) ! while (True): rows = messagestorestable.QueryRows(1, 0) if len(rows) != 1: break row = rows[0] ! propertyid, propertyvalue = row[0] ! if (propertyid == mapitags.PR_DEFAULT_STORE and propertyvalue == True): break --- 26,37 ---- messagestorestable.SetColumns((mapitags.PR_ENTRYID, mapitags.PR_DISPLAY_NAME_A, mapitags.PR_DEFAULT_STORE),0) ! while True: rows = messagestorestable.QueryRows(1, 0) + #if this is the last row then stop if len(rows) != 1: break row = rows[0] ! #if this is the default store then stop ! if ((mapitags.PR_DEFAULT_STORE,True) in row): break *************** *** 42,45 **** --- 43,49 ---- hr, props = msgstore.GetProps((mapitags.PR_IPM_OUTBOX_ENTRYID), 0) (tag, eid) = props[0] + #check for errors + if mapitags.PROP_TYPE(tag) == mapitags.PT_ERROR: + raise TypeError,'got PT_ERROR instead of PT_BINARY: %s'%eid outboxfolder = msgstore.OpenEntry(eid,None,mapi.MAPI_BEST_ACCESS) *************** *** 76,82 **** MAPIProfile = "" # Change this to a valid email address to test ! SendTo = "an.invalid@address" SendMessage = "testing one two three" SendSubject = "Testing Extended MAPI!!" SendEMAPIMail(SendSubject, SendMessage, SendTo, MAPIProfile=MAPIProfile) - --- 80,85 ---- MAPIProfile = "" # Change this to a valid email address to test ! SendTo = "an.invalid at address" SendMessage = "testing one two three" SendSubject = "Testing Extended MAPI!!" SendEMAPIMail(SendSubject, SendMessage, SendTo, MAPIProfile=MAPIProfile) |