Advertisement
Guest User

Untitled

a guest
Sep 7th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. >>> import smtplib
  2. >>> server = smtplib.SMTP('smtp.gmail.com', 587)
  3. >>> server.set_debuglevel(1)
  4. >>> server.ehlo()
  5. send: 'ehlo PKL-FKHAN-LT.mgc.mentorg.comrn'
  6. reply: '250-smtp.gmail.com at your service, [58.27.158.222]rn'
  7. reply: '250-SIZE 35882577rn'
  8. reply: '250-8BITMIMErn'
  9. reply: '250-STARTTLSrn'
  10. reply: '250-ENHANCEDSTATUSCODESrn'
  11. reply: '250-PIPELININGrn'
  12. reply: '250-CHUNKINGrn'
  13. reply: '250 SMTPUTF8rn'
  14. reply: retcode (250); Msg: smtp.gmail.com at your service, [58.27.158.222]
  15. SIZE 35882577
  16. 8BITMIME
  17. STARTTLS
  18. ENHANCEDSTATUSCODES
  19. PIPELINING
  20. CHUNKING
  21. SMTPUTF8
  22. (250, 'smtp.gmail.com at your service, [58.27.158.222]nSIZE 35882577n8BITMIME
  23. nSTARTTLSnENHANCEDSTATUSCODESnPIPELININGnCHUNKINGnSMTPUTF8')
  24. >>> server.starttls()
  25. send: 'STARTTLSrn'
  26. Traceback (most recent call last):
  27. File "<console>", line 1, in <module>
  28. File "C:Python27libsmtplib.py", line 645, in starttls
  29. (resp, reply) = self.docmd("STARTTLS")
  30. File "C:Python27libsmtplib.py", line 394, in docmd
  31. return self.getreply()
  32. File "C:Python27libsmtplib.py", line 365, in getreply
  33. + str(e))
  34. SMTPServerDisconnected: Connection unexpectedly closed: [Errno 10054] An existin
  35. g connection was forcibly closed by the remote host
  36.  
  37. EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
  38. EMAIL_USE_TLS = True
  39. EMAIL_PORT = 587
  40. EMAIL_HOST = 'smtp.gmail.com'
  41. EMAIL_HOST_USER = 'removed' #this is my gmails account email
  42. EMAIL_HOST_PASSWORD = "removed" #this is the gmails account password
  43. SERVER_EMAIL = "same as the EMAIL_HOST_USER"
  44. DEFAULT_FROM_EMAIL=EMAIL_HOST_USER
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement