Advertisement
Guest User

Untitled

a guest
Apr 18th, 2017
1,062
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.39 KB | None | 0 0
  1.  
  2.                 sender= "inioutgoingemail@gmail.com"
  3.                 receiver= note.customer.login
  4.          
  5.                 msg = MIMEMultipart()
  6.                 msg['From'] = 'cycomsoftware@cybersama.co.id'
  7.                 msg['To'] = note.customer.login
  8.                 msg['Subject'] = 'Dear '+note.customer.name+' Meeting Has been Confirm'
  9.                
  10.                 mail_body = 'Hy <strong>' + note.customer.name + '</strong>, your meeting  for '+note.name+' has been confrim  & will be lead by' +note.people.name+' from Cycom Software with detail '+note.tgl_permintaan_rapat+'on '+note.location+'. See you soon on meeting!'
  11.                 mail_body+= '<br/><strong> DO NOT REPLY THIS MESSAGE VIA EMAIL </strong> For detail information please login to our system <a href="http://app.cycomsoft.com:8069"> click this </a>'
  12.                 mime_body = MIMEText(mail_body, 'html')
  13.                 msg.attach(mime_body)
  14.                
  15.                 smtpObj = smtplib.SMTP(host='smtp.gmail.com', port=587)
  16.                 smtpObj.ehlo()
  17.                 smtpObj.starttls()
  18.                 smtpObj.ehlo()
  19.                 username="inioutgoingemail@gmail.com"
  20.                 pwd="inipasswordoutgoingserver"
  21.                
  22.                 smtpObj.login(user=username, password=pwd)
  23.                 smtpObj.sendmail(sender,receiver,msg.as_string())
  24.                 smtpObj.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement