Error with Simplemapi.py

Mick Duprez duprez at hinet.net.au
Fri Aug 24 03:03:05 EDT 2007


On Dec 24 2004, 4:56 pm, i... at kirbyfooty.com wrote:
> I wish I new why google doesn't show nicely aligned python code when
> you paste the script.
> Anyways, in case this helps someone else you can download the script
> fromhttp://www.kirbyfooty.com/simplemapi.py
>
> Ian

First of all, thanks to all involved, this looks like what I need
without re-inventing the wheel.
Sorry to Ian if he just recieved 2 emails, my bad, I need to learn how
to use this board better!

I have a small problem. I get an error I don't know how to resolve,
any help would be much appreciated.
I'm using Python25 on winXP pro and the script from the link above.
Here's the error -

>>> mailtest.SendMail('noone at somewhere.net','test','test string','c:\dbs.txt')

Traceback (most recent call last):
  File "<pyshell#10>", line 1, in <module>
    mailtest.SendMail('noone at somewhere.net','test','test string','c:
\dbs.txt')
  File "C:\Python25\mailtest.py", line 135, in SendMail
    cast(NULL, lpMapiRecipDesc), RecipCnt, recip,
  File "C:\Python25\lib\ctypes\__init__.py", line 478, in cast
    return _cast(obj, obj, typ)
ArgumentError: argument 1: <type 'exceptions.TypeError'>: wrong type
>>>

I have had a brief look at the C api for these structs and functions
but I can't resolve it, it is probably something simple.
The piece of code I don't understand though is this -

MapiRecipDesc_A = MapiRecipDesc * len(RecipWork) #size of struct??
rda = MapiRecipDesc_A() # isn't it MapiRecipDesc as declared??

There's some new stuff going on here I don't understand.

thanks for your help,
Mick.




More information about the Python-list mailing list