Guest User

Untitled

a guest
Jun 21st, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import email
  2. import smtplib
  3. import configparser
  4.  
  5. def sendmailtosupport(subject,body):
  6. addrs="support@aaa.com"
  7. sendmail(addrs,subject,body)
  8.  
  9. def sendmail(addr,subject,body):
  10. msg = email.message_from_string(body)
  11. msg['From'] = "abc@hotmail.com"
  12. msg['To'] = addr
  13. msg['Subject'] = subject
  14. s = smtplib.SMTP("smtp.live.com",587)
  15. s.ehlo() # Hostname to send for this command defaults to the fully qualified domain name of the local host.
  16. s.starttls() #Puts connection to SMTP server in TLS mode
  17. s.ehlo()
  18. s.login('abc@hotmail.com', 'xxx')
  19. s.sendmail("abc@hotmail.com", addr, msg.as_string())
  20. s.quit()
  21.  
  22.  
  23.  
  24. config = configparser.ConfigParser()
  25. config.sections()
  26. config.read('XXX.config')
  27. print(config['DEFAULT']['XXXend'])
  28.  
  29. try:
  30. print(0/0)
  31. except Exception as err:
  32. print(err)
  33.  
  34. [DEFAULT]
  35. Monthend = 2018-07-05
  36. # import pyodbc
Add Comment
Please, Sign In to add comment