My settings.py have actualy this config:
EMAIL_USE_TSL = True
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.kinghost.net'
EMAIL_HOST_USER = 'faleconosco@osvaldomarquescontabil.com.br'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_SUBJECT_PREFIX = '[OsvaldoMarques Contabil]'
EMAIL_PORT = 587
with this config i can send email in localhost with debug = TRUE but when i deploy here in pythonanywhere i receive connection refuse error and i dont know why... i already try ssl = false and true with port = 465 and nothing.... helṕ me please
2016-09-24 22:55:07,293 :Internal Server Error: /faleconosco/send_mail/
Traceback (most recent call last):
File "/home/osvaldomarquescontabil/omcontabilidade/omenv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/osvaldomarquescontabil/omcontabilidade/omenv/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/osvaldomarquescontabil/omcontabilidade/omenv/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/osvaldomarquescontabil/omcontabilidade/webpage/views.py", line 14, in enviar_email
email.enviar_email()
File "/home/osvaldomarquescontabil/omcontabilidade/webpage/models.py", line 17, in enviar_email
send_mail(self.assunto ,corpo , self.email_contato ,[ 'contato@osvaldomarquescontabil.com.br' ], fail_silently = False )
File "/home/osvaldomarquescontabil/omcontabilidade/omenv/lib/python3.5/site-packages/django/core/mail/__init__.py", line 62, in send_mail
return mail.send()
File "/home/osvaldomarquescontabil/omcontabilidade/omenv/lib/python3.5/site-packages/django/core/mail/message.py", line 342, in send
return self.get_connection(fail_silently).send_messages([self])
File "/home/osvaldomarquescontabil/omcontabilidade/omenv/lib/python3.5/site-packages/django/core/mail/backends/smtp.py", line 100, in send_messages
new_conn_created = self.open()
File "/home/osvaldomarquescontabil/omcontabilidade/omenv/lib/python3.5/site-packages/django/core/mail/backends/smtp.py", line 58, in open
self.connection = connection_class(self.host, self.port, **connection_params)
File "/usr/lib/python3.5/smtplib.py", line 251, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python3.5/smtplib.py", line 335, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python3.5/smtplib.py", line 306, in _get_socket
self.source_address)
File "/usr/lib/python3.5/socket.py", line 711, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 702, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused