Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Send an Email if We are running Low
- def checkemail(self):
- import smtplib
- global numbacomps
- global numbaphones
- # Mail protocol function within a function Jose...
- def mail(self):
- # From and To Addresses
- fromaddr = 'AutoNote@equatemedia.com'
- toaddrs = 'tech@budgetvanlines.com'
- # Credentials
- username = 'AutoNote@equatemedia.com'
- password = 'equatemedia1'
- # Send Mail
- server = smtplib.SMTP('smtp.gmail.com:587')
- server.starttls()
- server.login(username, password)
- server.sendmail(fromaddr, toaddrs, msg)
- server.quit()
- # Conditional Statements and mailing protocols
- if numbacomps < 3:
- msg = 'We are running low on Computer Headsets, Only %i remain. Please order more.' % numbacomps
- mail(self)
- if numbaphones < 3:
- msg = 'We are running low on Phone Headsets, Only %i remain. Please order more.' % numbaphones
- mail(self)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement