Re: Python To Send Emails Via Outlook Express
From: Ganesan R (rganesan_at_myrealbox.com)
Date: 12/21/04
- Next message: Miki Tebeka: "Re: embedding: forcing an interpreter to end"
- Previous message: Tim Peters: "Re: Should I always call PyErr_Clear() when an exception occurs?"
- In reply to: ian_at_kirbyfooty.com: "Re: Python To Send Emails Via Outlook Express"
- Next in thread: ian_at_kirbyfooty.com: "Re: Python To Send Emails Via Outlook Express"
- Reply: ian_at_kirbyfooty.com: "Re: Python To Send Emails Via Outlook Express"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 21 Dec 2004 11:54:22 +0530
>>>>> "ian" == ian <ian@kirbyfooty.com> writes:
> Hi Ganesan,
> I'm on the verge of giving up <sigh>
> I don't suppose you could write a small script to send the email for me
> via the default windows email client.
I can see no easy way to do this. Though you can access the default mail
client using a registry key (I don't have enough win32 programming
experience to do this), there is no guarantee that the email client is a COM
server. Even Outlook Express is not a COM server. What if the user has
configured Eudora or something like that?
The best we can do is use Outlook Express settings and send the mail.
> I will then try running your script and my end to see if it works ok. I
> may have missed something and would really appreciate your help.
The final script that you pasted:
=====
import win32com.client
s = win32com.client.Dispatch('CDO.Message')
s.From = "ian@cgbs.com.au"
s.To = "ian@kirbyfooty.com"
s.Subject = "The subject"
cdoSourceOutlookExpress = 2
s.Configuration.Load(cdoSourceOutlookExpress)
s.Send()
=====
works fine for me. According to CDO.Message documentation, if IIS is
installed that configuration will be used by default, followed by OE
configuration. I don't have IIS installed, so the script picked up the OE
configuration automatically for me. Here's a variation of the above
script.
======
import win32com.client
s = win32com.client.Dispatch('CDO.Message')
c = win32com.client.Dispatch('CDO.Configuration')
cdoSourceOutlookExpress = 2
c.Load(cdoSourceOutlookExpress)
s.Configuration = c
s.From = "ian@cgbs.com.au"
s.To = "ian@kirbyfooty.com"
s.Subject = "The subject"
s.Send()
======
If that doesn't help, I give up :-(.
Ganesan
- Next message: Miki Tebeka: "Re: embedding: forcing an interpreter to end"
- Previous message: Tim Peters: "Re: Should I always call PyErr_Clear() when an exception occurs?"
- In reply to: ian_at_kirbyfooty.com: "Re: Python To Send Emails Via Outlook Express"
- Next in thread: ian_at_kirbyfooty.com: "Re: Python To Send Emails Via Outlook Express"
- Reply: ian_at_kirbyfooty.com: "Re: Python To Send Emails Via Outlook Express"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|