[python-win32] MAPI with win32com

Werner F. Bruhin werner.bruhin at free.fr
Mon Mar 22 14:55:19 CET 2010


On 22/03/2010 14:28, King Simon-NFHD78 wrote:
>> -----Original Message-----
>> From: python-win32-bounces+simon.king=motorola.com at python.org
>> [mailto:python-win32-bounces+simon.king=motorola.com at python.or
>> g] On Behalf Of python at bdurham.com
>> Sent: 22 March 2010 13:11
>> To: Werner F. Bruhin; zz Python Win32 Newsgroup
>> Subject: Re: [python-win32] MAPI with win32com
>>
>> Werner,
>>
>> I'm not sure I understand the benefit of being locked into the
>> proprietary and awkward MAPI protocol?
>>
>> Why can't you use industry standard SMTP to send your
>> messages? Simpler
>> and more portable.
>>
>> Malcolm
>>
>
> I can't speak for Werner, but I recently had a request from a user of my
> application for an 'email this project' button on the toolbar, which
> would create an email message, attach the current project to it, and
> then allow the user to edit the message body itself.
>
> If I use SMTP, I need the user to enter all the SMTP configuration
> details (host, username, password, TLS etc). The email won't end up in
> his "Sent Items" folder. He probably won't be able to use Rich Text or
> HTML in the email (of course, you could argue that that is a good thing
> :-)
>
> Unfortunately, popping up an Outlook window with the file already
> attached is just a better user experience.
>
> I would love it if there were a way to do this that worked in the user's
> preferred mail client. If it were cross-platform, that would be even
> better. At the moment I use 'mailto:' URLs with os.startfile on Windows,
> and /usr/bin/open on the Mac. These work for opening an email with the
> To, Subject and message body already filled in, but I don't think
> there's any way I can attach a file like that. It also doesn't work if
> the message body is too long, presumably because of command-line length
> restrictions :-(
I used "mailto" in the past, but I need to attach log files, therefore I 
switched to using simplemapi.py which works fine except with the newer 
versions of Outlook (I know that Outlook included with Office 11 has a 
problem, not sure about others).

Werner



More information about the python-win32 mailing list