[python-win32] Accessing standard Mail-application

Steffen Frömer steffen at froemer.net
Fri Jul 8 21:04:45 CEST 2011


Hi,

i tried to access standard mail application to write a mail.
I know the machanism with urllib, but there is no regular way to add 
attachments.

Actually i do following:

app = "Outlook"

mailObj = win32com.client.gencache.EnsureDispatch("%s.Application" % app)
mail = mailObj.CreateItem(win32com.client.constants.olMailItem)
mail.Recipients.Add("mail (at) domain.de")
mail.Subject = "Subject"
mail.Body = "Body Msg"
mail.Attachments.Add('c:/temp/file.txt')

But there are Systems, which don't use MS Outlook.
Is there a way to access the standard mail application.

Regards,
Steffen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20110708/cb36f4f7/attachment.html>


More information about the python-win32 mailing list