Package Camelot :: Package camelot :: Package view :: Package export :: Module outlook
[frames] | no frames]

Source Code for Module Camelot.camelot.view.export.outlook

 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  
 
9 -def open_html_in_outlook(html):
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 #msg.BodyFormat=2 23 msg.HTMLBody=html 24 #msg.Subject=o_subject 25 msg.Display(True)
26