Create and display an email

Will McGugan news at NOwillmcguganSPAM.com
Thu Sep 15 06:34:21 EDT 2005


Adam Endicott wrote:
> I've got a wxPython based windows GUI application that takes some input
> and creates a PDF file output. At the end, I need to create an email
> message with this pdf file attached ready for the user to just hit
> "send". I don't want to actually send the email automatically, I just
> want to pop up a message in the default mail program that's ready to go
> (partially because the person might not be online when the email is
> created, this way they could just put it in their Outlook outbox).
> 
> I can't figure out how to do this. I've tried using
> webbrowser.open('mailto:...'), which works, except that I can't add an
> attachment that way (at least I haven't been successful). And I don't
> know any other way to open up a message in the default mail program.
> 
> There has to be something obvious that I'm missing here. Any
> suggestions?
> 

I dont think there is anything in the standard library to help you here. 
Windows has an api called 'MAPI' which does this sort of thing. There 
may be bindings to it somewhere, or you could create your own with 
ctypes. I sure you will find something now you know what to google for..

Will McGugan
-- 
http://www.willmcgugan.com
"".join({'*':'@','^':'.'}.get(c,0) or chr(97+(ord(c)-84)%26) for c in 
"jvyy*jvyyzpthtna^pbz")



More information about the Python-list mailing list