python - Email not sending with django 1.9 -
i've been trying email working project i've been working on, believe it's configured correctly, here settings.py, command i'm running, , traceback when stop it.
email configuration:
#email configuration default_from_email = #email address server_email = #email address email_use_tls = true email_host = "smtp.gmail.com" email_port = 587 email_host_user = #email address email_host_password = "**********"
command:
send_mail("test", "test", "from_email@gmail.com", ["to_email@gmail.com"], fail_silently=false)
traceback:
^ctraceback (most recent call last): file "<console>", line 1, in <module> file "/home/django/djangoapps/connectedfeedback/py3_env/lib/python3.4/site-packages/django/core/mail/__init__.py", line 61, in send_mail return mail.send() file "/home/django/djangoapps/connectedfeedback/py3_env/lib/python3.4/site-packages/django/core/mail/message.py", line 292, in send return self.get_connection(fail_silently).send_messages([self]) file "/home/django/djangoapps/connectedfeedback/py3_env/lib/python3.4/site-packages/django/core/mail/backends/smtp.py", line 100, in send_messages new_conn_created = self.open() file "/home/django/djangoapps/connectedfeedback/py3_env/lib/python3.4/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.4/smtplib.py", line 242, in __init__ (code, msg) = self.connect(host, port) file "/usr/lib/python3.4/smtplib.py", line 321, in connect self.sock = self._get_socket(host, port, self.timeout) file "/usr/lib/python3.4/smtplib.py", line 292, in _get_socket self.source_address) file "/usr/lib/python3.4/socket.py", line 503, in create_connection sock.connect(sa) keyboardinterrupt
what doing wrong?
edit: ran telnet smtp.gmail.com 587
, sat there 5 minutes connected
so ended being issue google account security. google blocking sign in attempt.
Comments
Post a Comment