#!/usr/bin/python3
#=====================================================================================================
# send email message
#===================================================================================================== 
import sys
sys.path.insert(0,'/home/s/sultans/web/python/demo/etl/util')
import emailFunc                                                #import email custom function

print("Content-Type: text/html \n")                             #http header with newline (required for web)

fromAddr =  'ss4922@nyu.edu'                                    #single from email address                                  
#toAddr  =  'sam.sultan@hbo.com'                                #single to email address
toAddr   = ['samuel.sultan@columbia.edu','sam.sultan@hbo.com']  #multiple to addresses (place in a list)
subject  =  'message subject1'                                  #the message subject
message  = '''this is the full body of the message
              and this is line 2 of the message'''             

emailFunc.send(fromAddr, toAddr, subject, message)

emailFunc.send('ss4922@nyu.edu',                                #another more compact example 
               'sam.sultan@hbo.com',   
               'message subject2',
                message) 

print('Email send successfully')