Django Sending Email : SMTPServerDisconnected: Connection unexpectedly closed

后端 未结 6 1736

hello i want to sending email activation use django registration redux.

this is my setting.py

EMAIL_BACKEND = \'django.core.mail.backends.smtp.EmailBackend         


        
6条回答
  •  清歌不尽
    2021-02-13 02:48

    To use port 465, you need to call smtplib.SMTP_SSL(). Currently, it calls smtplib.SMTP() .. so,change your PORT from 465 into 587 it

    if you want use PORT 465,

    your EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend'

    `EMAIL_PORT=465`  
    

    and you need to install django_smtp_ssl

    otherwise you can keep,

    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

    EMAIL_PORT=465
    

提交回复
热议问题