invoke user's standard mail client

Leo Kislov Leo.Kislov at gmail.com
Tue May 8 01:15:37 EDT 2007


On May 7, 2:00 pm, "luc.saf... at gmail.com" <luc.saf... at gmail.com>
wrote:
> On May 7, 10:28 am, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
> wrote:
>
>
>
> > Get the pywin32 package (Python for Windows extensions) from sourceforge,
> > install it, and look into the win32comext\mapi\demos directory.
>
> Thanks for the hint, Gabriel.
> Wow, that's heavily spiced code! When I invoke mapisend.py I get:
>
>   Traceback (most recent call last):
>     File "mapisend1.py", line 85, in <module>
>       SendEMAPIMail(SendSubject, SendMessage, SendTo,
> MAPIProfile=MAPIProfile)
>     File "mapisend1.py", line 23, in SendEMAPIMail
>       mapi.MAPIInitialize(None)
>   pywintypes.com_error: (-2147467259, 'Unspecified error', None, None)
>
> But what is a MAPI profile?

It's an abstraction of incoming and outgoing mail accounts. In UNIX
terms it's kind of like running local sendmail that forwards mail to
another server and fetchmail that fetches mail from external inboxes,
e.g. it's a proxy between you and outgoing/incoming mail server.

> I left this variable blank. Do I need MS
> Exchange Server to run this demo?

No, but you need an account on some mail server and some email program
should create a MAPI profile to represent that account on your local
computer. As I understand creation of MAPI profiles is not a common
practice among non-Microsoft products, for example my computer with
Lotus Notes doesn't have any MAPI profiles.

  -- Leo




More information about the Python-list mailing list