Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> import smtplib
- >>> server = smtplib.SMTP('smtp.gmail.com', 587)
- >>> server.set_debuglevel(1)
- >>> server.ehlo()
- send: 'ehlo PKL-FKHAN-LT.mgc.mentorg.comrn'
- reply: '250-smtp.gmail.com at your service, [58.27.158.222]rn'
- reply: '250-SIZE 35882577rn'
- reply: '250-8BITMIMErn'
- reply: '250-STARTTLSrn'
- reply: '250-ENHANCEDSTATUSCODESrn'
- reply: '250-PIPELININGrn'
- reply: '250-CHUNKINGrn'
- reply: '250 SMTPUTF8rn'
- reply: retcode (250); Msg: smtp.gmail.com at your service, [58.27.158.222]
- SIZE 35882577
- 8BITMIME
- STARTTLS
- ENHANCEDSTATUSCODES
- PIPELINING
- CHUNKING
- SMTPUTF8
- (250, 'smtp.gmail.com at your service, [58.27.158.222]nSIZE 35882577n8BITMIME
- nSTARTTLSnENHANCEDSTATUSCODESnPIPELININGnCHUNKINGnSMTPUTF8')
- >>> server.starttls()
- send: 'STARTTLSrn'
- Traceback (most recent call last):
- File "<console>", line 1, in <module>
- File "C:Python27libsmtplib.py", line 645, in starttls
- (resp, reply) = self.docmd("STARTTLS")
- File "C:Python27libsmtplib.py", line 394, in docmd
- return self.getreply()
- File "C:Python27libsmtplib.py", line 365, in getreply
- + str(e))
- SMTPServerDisconnected: Connection unexpectedly closed: [Errno 10054] An existin
- g connection was forcibly closed by the remote host
- EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
- EMAIL_USE_TLS = True
- EMAIL_PORT = 587
- EMAIL_HOST = 'smtp.gmail.com'
- EMAIL_HOST_USER = 'removed' #this is my gmails account email
- EMAIL_HOST_PASSWORD = "removed" #this is the gmails account password
- SERVER_EMAIL = "same as the EMAIL_HOST_USER"
- DEFAULT_FROM_EMAIL=EMAIL_HOST_USER
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement