Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Fun with Outlook and MAPI

Reply
Thread Tools

Fun with Outlook and MAPI

 
 
Chris
Guest
Posts: n/a
 
      12-13-2004
>>At the risk of beating a dead horse, but you really should consider
>>using SMTP instead if you are really going to be sending a lot
>>of messages.

> The problem is that doesn't work in more complicated configurations
> such as when authentication and/or SSL have to happen, not to mention
> the issue of configuring servers and ports, that users have already
> configured in their mail clients. Additionally when you use MAPI,
> messages that you send also end up in your sent items folder. (I
> also have not had any issue sending lots of messages using MAPI).
>
> Ultimately the utility of vanilla of pure SMTP will depend on
> customer requirements and how simple the configuration is.


That pretty much sums it up. Also, since everything is done over IMAP
with Outlook, I don't really have access to an SMTP server.

Chris
 
Reply With Quote
 
 
 
 
Chris
Guest
Posts: n/a
 
      12-13-2004
> There is actually a workaround. You're using Simple MAPI which has a
> nice easy interface. The confirmation dialogs are only for Simple MAPI.
> Using Extended MAPI can work around the problem but its a lot more tricky.
> See the initial discussion here:
> http://aspn.activestate.com/ASPN/Mai...-win32/2160646
>
> This code has now been included in pywin32 somehow but I can't remember
> where and its late. Should also be a cookbook entry. Maybe Google can
> help


Okay, here's the results. The good news is that the code sent the mail
without any popup's. The bad news is that the sent e-mail stays in the
outbox instead of the sent folder. Any suggestions?

Chris
 
Reply With Quote
 
 
 
 
Steve Holden
Guest
Posts: n/a
 
      12-13-2004
Chris wrote:

>> There is actually a workaround. You're using Simple MAPI which has a
>> nice easy interface. The confirmation dialogs are only for Simple
>> MAPI. Using Extended MAPI can work around the problem but its a lot
>> more tricky.
>> See the initial discussion here:
>> http://aspn.activestate.com/ASPN/Mai...-win32/2160646
>>
>> This code has now been included in pywin32 somehow but I can't
>> remember where and its late. Should also be a cookbook entry. Maybe
>> Google can help

>
>
> Okay, here's the results. The good news is that the code sent the mail
> without any popup's. The bad news is that the sent e-mail stays in the
> outbox instead of the sent folder. Any suggestions?
>
> Chris


Well, only the same one I've already made, which is to look on the
win32all mailing list archives. Since this appears to be beyond you,
here's a note by Chad Stryker commenting on an original work by David
Fraser.

It may give you the clues you need, otherwise Google for the whole
thread(s).

"""Thank you for figuring this extended MAPI interface all out. I
discovered a couple of problems with the code (on my system at least).
First, the message in my outbox was marked as read. Second, the message
would remain in the outbox after it was sent. After several hours of
work, I added three lines to the function that mark the message as
unread and cause the message to be deleted from the outbox after it is sent.

First, I added a constant that I found in the MAPI header file MAPIDefS.h.

CLEAR_READ_FLAG = 4

Next I added two lines just before “outboxfolder.SaveChanges(0)”.

message.SetReadFlag(CLEAR_READ_FLAG)
message.SetProps([(mapitags.PR_DELETE_AFTER_SUBMIT,1)])

With these changes, the behavior in the outbox is consistent with
sending messages directly from Outlook.
"""

regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
 
Reply With Quote
 
Chris
Guest
Posts: n/a
 
      12-13-2004
>> Okay, here's the results. The good news is that the code sent the
>> mail without any popup's. The bad news is that the sent e-mail stays
>> in the outbox instead of the sent folder. Any suggestions?

> Well, only the same one I've already made, which is to look on the
> win32all mailing list archives. Since this appears to be beyond you,
> here's a note by Chad Stryker commenting on an original work by David
> Fraser.
>
> It may give you the clues you need, otherwise Google for the whole
> thread(s).
>
> """Thank you for figuring this extended MAPI interface all out. I
> discovered a couple of problems with the code (on my system at least).
> First, the message in my outbox was marked as read. Second, the message
> would remain in the outbox after it was sent. After several hours of
> work, I added three lines to the function that mark the message as
> unread and cause the message to be deleted from the outbox after it is
> sent.
>
> First, I added a constant that I found in the MAPI header file MAPIDefS.h.
>
> CLEAR_READ_FLAG = 4
>
> Next I added two lines just before “outboxfolder.SaveChanges(0)”.
>
> message.SetReadFlag(CLEAR_READ_FLAG)
> message.SetProps([(mapitags.PR_DELETE_AFTER_SUBMIT,1)])
>
> With these changes, the behavior in the outbox is consistent with
> sending messages directly from Outlook.
> """
>
> regards
> Steve


Actually, I had already found that message. It still doesn't do what
I'm looking for(namely moving sent messages to the Sent folder).

Chris
 
Reply With Quote
 
Steve Holden
Guest
Posts: n/a
 
      12-13-2004
Chris wrote:

>>> Okay, here's the results. The good news is that the code sent the
>>> mail without any popup's. The bad news is that the sent e-mail stays
>>> in the outbox instead of the sent folder. Any suggestions?

>>
>> Well, only the same one I've already made, which is to look on the
>> win32all mailing list archives. Since this appears to be beyond you,
>> here's a note by Chad Stryker commenting on an original work by David
>> Fraser.
>>
>> It may give you the clues you need, otherwise Google for the whole
>> thread(s).
>>
>> """Thank you for figuring this extended MAPI interface all out. I
>> discovered a couple of problems with the code (on my system at least).
>> First, the message in my outbox was marked as read. Second, the
>> message would remain in the outbox after it was sent. After several
>> hours of work, I added three lines to the function that mark the
>> message as unread and cause the message to be deleted from the outbox
>> after it is sent.
>>
>> First, I added a constant that I found in the MAPI header file
>> MAPIDefS.h.
>>
>> CLEAR_READ_FLAG = 4
>>
>> Next I added two lines just before “outboxfolder.SaveChanges(0)”.
>>
>> message.SetReadFlag(CLEAR_READ_FLAG)
>> message.SetProps([(mapitags.PR_DELETE_AFTER_SUBMIT,1)])
>>
>> With these changes, the behavior in the outbox is consistent with
>> sending messages directly from Outlook.
>> """
>>
>> regards
>> Steve

>
>
> Actually, I had already found that message. It still doesn't do what
> I'm looking for(namely moving sent messages to the Sent folder).
>
> Chris
>
>

Well, in that case please excuse my crotchetiness. It's probably the
time of year.

bah-humbug-ly y'rs - steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Win32Ole, MAPI, and Outlook Jeff Miller Ruby 3 03-25-2008 05:42 AM
3 PIX VPN questions - FUN FUN FUN frishack@gmail.com Cisco 3 03-16-2006 02:25 PM
MAPI extension for non-MAPI enabled email clients? hugh jass Computer Support 0 02-11-2005 12:20 PM
Fun fun fun Luke Computer Support 3 10-07-2003 03:45 PM
simple-mapi, python, and outlook express Mark Hahn Python 1 09-12-2003 07:12 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57