Re: Fun with Outlook and MAPI
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
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/Mail/Message/Python-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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
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/Mail/Message/Python-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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
Chris wrote: Alas, I dont think that there is much you can do to prevent the confirmation dialogs with Outlook's MAPI dll. MS added them in a service pack as an anti-virus measure, so no work-around. Not all clients show these anoying dialogs though. Thunderbird definately doesn't. 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/Mail/Message/Python-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 :-) Cool. I'll take a look an' see if I can get it to work. MAPI has turned out to be a major PITA. Especially when trying to learn it and Python at the same time. :) Chris There's recently been some discussion of this topic on the python-win32 list, most lately to accommodate moving sent messages to the Sent folder. I've personally sent several hundred messages using the techniques outlined there. http://mail.python.org/pipermail/python-win32/2004-August/002239.html is a good starting point. regards Steve -- http://www.holdenweb.com http://pydish.holdenweb.com Holden Web LLC +1 800 494 3119 -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
"Larry Bates" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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. Roger -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
"Chris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > My only problem is that when I call Resolve() and Send(), I get confirmation > dialogs. I will be sending out quite a few e-mails > at a time, and would rather not have the user have to click yes for every > single one. Here is an simple workaround: http://www.contextmagic.com/express-clickyes/ If you have win32all installed, you can even use the programming API they present to turn on and off the clickyes functionality. Roger -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
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. I think you will find it more reliable and much faster. It also eliminates the need for ANY email client to be on the machine that is sending the messages. http://motion.technolust.cx/related/send_jpg.py Here is a link to a class that wraps everything up very nicely. You should be able to be sending SMTP emails with it in 10-15 minutes. It supports binary attachments as well. FYI, Larry Bates Chris wrote: I'm trying to send an e-mail through outlook. So far I've gotten it to work with the mail script at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/149461 My only problem is that when I call Resolve() and Send(), I get confirmation dialogs. I will be sending out quite a few e-mails at a time, and would rather not have the user have to click yes for every single one. Does anyone know a workaround? I know about smtplib, but I would prefer to simply make what I have work. Thanks. Chris -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
Alas, I dont think that there is much you can do to prevent the confirmation dialogs with Outlook's MAPI dll. MS added them in a service pack as an anti-virus measure, so no work-around. Not all clients show these anoying dialogs though. Thunderbird definately doesn't. 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/Mail/Message/Python-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 :-) Cool. I'll take a look an' see if I can get it to work. MAPI has turned out to be a major PITA. Especially when trying to learn it and Python at the same time. :) Chris -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
Will McGugan wrote: I'm trying to send an e-mail through outlook. So far I've gotten it to work with the mail script at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/149461 My only problem is that when I call Resolve() and Send(), I get confirmation dialogs. I will be sending out quite a few e-mails at a time, and would rather not have the user have to click yes for every single one. Does anyone know a workaround? I know about smtplib, but I would prefer to simply make what I have work. Thanks. Alas, I dont think that there is much you can do to prevent the confirmation dialogs with Outlook's MAPI dll. MS added them in a service pack as an anti-virus measure, so no work-around. Not all clients show these anoying dialogs though. Thunderbird definately doesn't. Unfortunately, I don't have the option of installing Thunderbird. Chris -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
David Fraser wrote: Alas, I dont think that there is much you can do to prevent the confirmation dialogs with Outlook's MAPI dll. MS added them in a service pack as an anti-virus measure, so no work-around. Not all clients show these anoying dialogs though. Thunderbird definately doesn't. There is actually a workaround. You're using Simple MAPI which has a I stand corrected. Will McGugan -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
Will McGugan wrote: Chris wrote: I'm trying to send an e-mail through outlook. So far I've gotten it to work with the mail script at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/149461 My only problem is that when I call Resolve() and Send(), I get confirmation dialogs. I will be sending out quite a few e-mails at a time, and would rather not have the user have to click yes for every single one. Does anyone know a workaround? I know about smtplib, but I would prefer to simply make what I have work. Thanks. Alas, I dont think that there is much you can do to prevent the confirmation dialogs with Outlook's MAPI dll. MS added them in a service pack as an anti-virus measure, so no work-around. Not all clients show these anoying dialogs though. Thunderbird definately doesn't. 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/Mail/Message/Python-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 :-) David -- http://mail.python.org/mailman/listinfo/python-list
Re: Fun with Outlook and MAPI
Chris wrote: I'm trying to send an e-mail through outlook. So far I've gotten it to work with the mail script at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/149461 My only problem is that when I call Resolve() and Send(), I get confirmation dialogs. I will be sending out quite a few e-mails at a time, and would rather not have the user have to click yes for every single one. Does anyone know a workaround? I know about smtplib, but I would prefer to simply make what I have work. Thanks. Alas, I dont think that there is much you can do to prevent the confirmation dialogs with Outlook's MAPI dll. MS added them in a service pack as an anti-virus measure, so no work-around. Not all clients show these anoying dialogs though. Thunderbird definately doesn't. Regards, Will McGugan -- http://mail.python.org/mailman/listinfo/python-list
Fun with Outlook and MAPI
I'm trying to send an e-mail through outlook. So far I've gotten it to work with the mail script at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/149461 My only problem is that when I call Resolve() and Send(), I get confirmation dialogs. I will be sending out quite a few e-mails at a time, and would rather not have the user have to click yes for every single one. Does anyone know a workaround? I know about smtplib, but I would prefer to simply make what I have work. Thanks. Chris -- http://mail.python.org/mailman/listinfo/python-list