win32com: create email message in windows default app?
Syver Enstad
syver-en+usenet at online.no
Sun Sep 7 15:36:03 EDT 2003
"News M Claveau /Hamster-P" <essai1 at mci.local> writes:
> Hi !
>
> But what is "windows default email application" ?
That is the application currently chosen as the mail application in
Internet Options / Programs. These settings will be used by any
application that is a Mapi client.
> In windows, with WSH, you can write :
> Dim str,objEmail
> Set objEmail = CreateObject("CDO.Message")
> objEmail.From = "toto at titi.fr"
> objEmail.To = "tata at tutu.com"
> objEmail.Subject = "Msg-try"
> objEmail.Textbody = "Corps (body) du (of) message."
> objEmail.Send
> Wscript.quit
You should be equally able to use this with python. Just use
win32com.client instead:
Like this:
import win32com.client
objEmail = win32com.client.Dispatch('CDO.Message')
and so on.
That reason that this works is that CDO uses Mapi behind the scenes.
--
Vennlig hilsen
Syver Enstad
More information about the Python-list
mailing list