python - error no 10061 in django when sending mail -
i use 10061 server. code like,
setting.py:
email_backend = 'django.core.mail.backends.smtp.emailbackend' views.py:
def trying(request): message = request.post.get('message', '') if message: try: send_mail("testing", message, "s.tanna1992@gmail.com",['s.tanna1992@gmail.com']) except badheadererror: return httpresponse('invalid header found.') return httpresponse('send successfully...1') else: # in reality we'd use form class # proper validation errors. return httpresponse('make sure fields entered , valid.') which setting should configure without firewall? neccessary define port? if is, should define?
in settings.py file, defining things email_host, email_port, etc?
see django documentation various settings can use.
Comments
Post a Comment