Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import email
- import smtplib
- import configparser
- def sendmailtosupport(subject,body):
- addrs="support@aaa.com"
- sendmail(addrs,subject,body)
- def sendmail(addr,subject,body):
- msg = email.message_from_string(body)
- msg['From'] = "abc@hotmail.com"
- msg['To'] = addr
- msg['Subject'] = subject
- s = smtplib.SMTP("smtp.live.com",587)
- s.ehlo() # Hostname to send for this command defaults to the fully qualified domain name of the local host.
- s.starttls() #Puts connection to SMTP server in TLS mode
- s.ehlo()
- s.login('abc@hotmail.com', 'xxx')
- s.sendmail("abc@hotmail.com", addr, msg.as_string())
- s.quit()
- config = configparser.ConfigParser()
- config.sections()
- config.read('XXX.config')
- print(config['DEFAULT']['XXXend'])
- try:
- print(0/0)
- except Exception as err:
- print(err)
- [DEFAULT]
- Monthend = 2018-07-05
- # import pyodbc
Add Comment
Please, Sign In to add comment