1 import logging
2 logger = logging.getLogger('camelot.view.export.outlook')
3
4 """Functions to send files by email using outlook
5
6 After http://win32com.goermezer.de/content/view/227/192/
7 """
8
10
11 try:
12 import pythoncom
13 import win32com.client
14 pythoncom.CoInitialize()
15 outlook_app = win32com.client.Dispatch("Outlook.Application")
16 except Exception, e:
17 """We're probably not running windows"""
18 logger.warn('unable to launch Outlook', exc_info=e)
19 return
20
21 msg = outlook_app.CreateItem(0)
22
23 msg.HTMLBody=html
24
25 msg.Display(True)
26