Connection timeout issue sending email in Django

后端 未结 2 1843
無奈伤痛
無奈伤痛 2021-01-13 07:29

I read from

http://www.packtpub.com/article/friends-via-email-social-web-application-django-1.0

and follow the steps: => And change my setting.py



        
相关标签:
2条回答
  • 2021-01-13 07:44

    You code looks correct, so I think there is a problem with your settings. Are you positive that specified the EMAIL_HOST and EMAIL_PORT correctly?

    Note: Its EMAIL_USE_TLS not MAIL_USE_TLS and you can set your from address (3rd parameter in send_mail function) to None if you want it to take your DEFAULT_FROM_EMAIL value.

    0 讨论(0)
  • 2021-01-13 07:45

    'Connection timed out' means Django couldn't connect to your email server. Type this on a command line:

    telnet smtp.xxxx.com.kh 25
    

    You should get a response from the email server, something like:

    220 rufus Python SMTP proxy version 0.2
    

    If you don't get a response,you have found the problem.

    Here's a handy command to run a local development server, on Linux:

    sudo /usr/lib/python2.6/smtpd.py -n -c DebuggingServer 127.0.0.1:25
    
    0 讨论(0)
提交回复
热议问题