Python and MAPI

Grant Edwards grant at nowhere.
Tue Jan 18 17:22:35 EST 2000


In article <slrn889o9j.3oa.grant at grante.comtrol.com>, Grant Edwards wrote:

>------------------------------------------------------------
>import win32com.client
>import win32com.mapi.mapitags
>
>session = win32com.client.Dispatch("MAPI.Session")
>session.Logon("MS Exchange Settings")
>outbox=session.Outbox
>collmsg=outbox.Messages
>msgo=collmsg.Add("subj text","message text",win32com.mapi.mapitags.PR_MESSAGE_CLASS,1)
>msgo.Recipients.Add("grante at visi.com")
>msgo.Sender.Address="grant.edwards at comtrol.com"
>msgo.Send(1,0)
>session.Logoff
>------------------------------------------------------------
>
>It bombs at line msgo.Sender.Address="" line with the following
>error:
>
>com_error: (-2147221233, 'OLE error 0x8004010f', (1271, 'Collaboration Data Objects', ' [Collaboration Data Objects - [MAPI_E_NOT_FOUND(8004010F)]]', None, 0, -2147221233), None)

If I comment out the msgo.Sender.Address line, then I get an
error when I make the msgo.Send(1,0) call:

  File "U:\Grante\python\testSend.py", line 11, in ?
    msgo.Send(1,0)
  File "<COMObject <unknown>>", line 2, in Send
  File "C:\Program Files\Python\win32com\client\dynamic.py", line 207, in _ApplyTypes_
    result = apply(self._oleobj_.InvokeTypes, (dispid, LCID, wFlags, retType, argTypes) + args)
com_error: (-2147467259, 'Unspecified error', (17389, 'Collaboration Data Objects', ' [Collaboration Data Objects - [E_FAIL(80004005)]]', None, 0, -2147467259), None)

???

-- 
Grant Edwards                   grante             Yow!  My Aunt MAUREEN was
                                  at               a military advisor to IKE &
                               visi.com            TINA TURNER!!



More information about the Python-list mailing list