[Tutor] Send attachment

Liam Clarke cyresse at gmail.com
Fri Jul 22 01:45:04 CEST 2005


If it's Outlook, you can use the win32python library to control it via 
ActiveX/COM+

http://starship.python.net/crew/mhammond/

Here's an example using VB to control Outlook - 
http://support.microsoft.com/?kbid=220595

The language differs, but the basic principle remains the same. 

Create an Application.Outlook object, and then use it's methods. 

I know there's a way to use the default mail client 
( as in Excel VBA's - application.showdialog(xlDialogs.SendMail) ) but 
blowed if I can figure it out. The above VBA bit automatically attaches the 
open spreadsheet, so unsure if you can hijack it. 


Good luck, and if you google how to use the default email client, let me 
know!

Liam Clarke

On 7/22/05, Jorge Louis De Castro <jorge at bcs.org.uk> wrote:
> 
> Hello,
>  Any ideas how I can use Python and the Windows API to open a PC's mail 
> client and send an attachment?
> The idea is saving some data onto a file and then invoke the email client 
> (OE or Outlook or whatever is the default on the machine) with the 
> recipient's address filled in and the file ready to be sent as an 
> attachment. 
> Kinda like when we right-click on a file and select the "send to mail 
> recipient" behavior.
> Been reading docs, trying out samples, and googling this for a few days to 
> no avail.
>  Cheers
> jorge
> 
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
> 
> 


-- 
'There is only one basic human right, and that is to do as you damn well 
please.
And with it comes the only basic human duty, to take the consequences.'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050722/ebfaf29f/attachment.htm


More information about the Tutor mailing list