Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import smtplib
  2. import os
  3.  
  4. s= smtplib.SMTP('smtp.sendgrid.net', 587)
  5. s.starttls()
  6. #(220, 'Begin TLS negotiation now')
  7. s.ehlo("staging2.pq.dsd.io")
  8. #(250, 'smtp.sendgrid.net\n8BITMIME\nPIPELINING\nSIZE 31457280\nSTARTTLS\nAUTH PLAIN LOGIN\nAUTH=PLAIN LOGIN')
  9. s.login(os.environ['SMTP_USERNAME'], os.environ['SMTP_PASSWORD'])
  10. #Traceback (most recent call last):
  11. # File "<stdin>", line 1, in <module>
  12. # File "/usr/lib/python2.7/smtplib.py", line 622, in login
  13. # raise SMTPAuthenticationError(code, resp)
  14. #smtplib.SMTPAuthenticationError: (535, 'Authentication failed: Bad username / password')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement