I’ve started a new production droplet in NYC2, it has virt-io, and backup.
I have a django application with many other services running, like redis, node, sockjs and celery.
Also, i want to point ou that my local server runs the exact same configuration with regards to email, and everything works fine. I did not change anything regarding to firewall or networking in my droplet.
Can anybody help me fix this error?
My problem is that i can’t send email from my django app.
My configuration is :
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587 #also tried with 465
EMAIL_HOST_USER = 'xxxxxxxxxx@gmail.com'
EMAIL_HOST_PASSWORD = 'MyPassWOrd'
Here is the error:
File "<console>", line 1, in <module>
File "......./models.py", line 158, in email_user
send_mail(subject, message, from_email, [self.email])
File "......./local/lib/python2.7/site-packages/django/core/mail/__init__.py", line 50, in send_mail
connection=connection).send()
File "........./local/lib/python2.7/site-packages/django/core/mail/message.py", line 274, in send
return self.get_connection(fail_silently).send_messages([self])
File "........./local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 87, in send_messages
new_conn_created = self.open()
File "........./local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 48, in open
local_hostname=DNS_NAME.get_fqdn())
File "/usr/lib/python2.7/smtplib.py", line 251, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python2.7/smtplib.py", line 311, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python2.7/smtplib.py", line 286, in _get_socket
return socket.create_connection((host, port), timeout)
File "/usr/lib/python2.7/socket.py", line 571, in create_connection
raise err
error: [Errno 101] Network is unreachable
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I am getting “error: [Errno 101] Network is unreachable” . If you have fixed the issue then please help !!
It looks like SMTP is blocked on your droplet – please open up a support ticket so we can unblock it. Thanks!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.