Guest User

Untitled

a guest
Oct 8th, 2020
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import win32com.client as win32
  2. def Emailer(subject, recipient, auto=True):
  3. outlook = win32.Dispatch('outlook.application')
  4. mail = outlook.CreateItem(0)
  5. mail.To = recipient
  6. mail.CC = recipientCC
  7. mail.Subject = subject
  8.  
  9. #mail.HtmlBody="test"
  10. fo = open("save_out_alarm.txt", "r")
  11. text = fo.read()
  12. List_tesx=text.split("\n")
  13. for line in List_tesx:
  14. mail.HtmlBody=line
  15. if auto:
  16. mail.Display(True)
  17. else:
  18. mail.open # or whatever the correct code is
  19. Emailer(subject, recipient, recipientCC)
Advertisement
Add Comment
Please, Sign In to add comment