# \[Errno 111\] Connection refused on smtp.gmail.com

**URL:** <https://forum.djangoproject.com/t/errno-111-connection-refused-on-smtp-gmail-com/29322>\
**Category:** Deployment\
**Created:** [March 21, 2024, 5:42am UTC](https://forum.djangoproject.com/t/errno-111-connection-refused-on-smtp-gmail-com/29322 "2024-03-21T05:42:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shyamra](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/shyamra/32/20055_2.png) [@Shyamra](https://forum.djangoproject.com/u/Shyamra)\
**Post date:** [March 21, 2024, 5:42am UTC](https://forum.djangoproject.com/t/errno-111-connection-refused-on-smtp-gmail-com/29322/1 "2024-03-21T05:42:21Z")

</div>

![Untitled](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/4/a/4ab0b8e130ee0d431a32a08fa83f1542457780a0.png)  
EMAIL\_BACKEND = ‘django.core.mail.backends.smtp.EmailBackend’  
EMAIL\_HOST = ‘[smtp.gmail.com](http://smtp.gmail.com)’  
EMAIL\_PORT = 587  
EMAIL\_USE\_TLS = True  
EMAIL\_USE\_SSL = False  
EMAIL\_HOST\_USER = ‘shyamrathod173@gmail.com’  
EMAIL\_HOST\_PASSWORD = ‘XXXXXXX’  
When i am check on localhost it’s work well but when i am check on host on cpanel it’s throw error

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 21, 2024, 10:55am UTC](https://forum.djangoproject.com/t/errno-111-connection-refused-on-smtp-gmail-com/29322/2 "2024-03-21T10:55:13Z")

</div>

Welcome @Shyamra !

When requesting assistance with an error message, it’s usually more helpful to get the error and traceback from the server logs than the excerpt shown in the browser.

In this specific case, an Error 111 in a general connection error. For whatever reason, the host you’re running this on was unable to open a connection to `smtp.gmail.com`. There are a number of different possibilities for this error:

- There’s an outbound firewall on your host network preventing outbound connections on port 587.

- There’s an outbound firewall on your host network preventing outbound connections to `smtp.gmail.com`.

- There’s a DNS issue in your host system’s network providing the wrong address for `smtp.gmail.com`.

- gmail is currently blocking access for smtp connections from your IP address or subnet. (This is more likely than it sounds. Google is getting more proactive regarding the reduction of spam and continues to add restrictions and limitations regarding the systems from which it will accept email.)

(There are other possibilities as well - these are just the ones I can think of right now.)

Finding the cause will require you to do the research with your hosting provider (and possibly Google) to determine if it’s one of these issues - or something else.
