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