Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import pandas as pd
  2. import smtplib
  3.  
  4.  
  5. df = pd.read_csv('file.csv')
  6.  
  7. df['Shipping Tier'] = df['2day ship']
  8. df['Capacity'] = df['Planned Capacity']
  9. df['Max Date'] = df['Date']
  10.  
  11. df2 = df[['Distributor ID','Distributor Name', 'Shipping Tier','Capacity', 'Max Date']]
  12.  
  13. smtpObj = smtplib.SMTP('smtp-mail.outlook.com', 587)
  14. type(smtpObj
  15.  
  16. smtpObj.starttls()
  17. smtpObj.login('myemail, 'pw')
  18.  
  19. ##vendors = df['Distributor ID']
  20. emails = df['Email'].tolist()
  21. ##emailAndVendors = []
  22.  
  23.  
  24. for i in range(len(emails)):
  25. FROM = 'myemail'
  26. TO = str(emails)
  27. SUBJECT = 'subject'
  28. TEXT = '''Hello DSV Partner,\n\nYou have consumed your daily capacity which could push out customer promise dates and negatively affect sales.
  29.  
  30.  
  31.  
  32.  
  33. '''
  34.  
  35. message = """\
  36. From: %s
  37. To: %s
  38. Subject: %s
  39.  
  40. %s
  41. """ % (FROM, TO, SUBJECT, TEXT)
  42.  
  43. smtpObj.sendmail(FROM, TO, message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement