I'm in the process of getting G Suite to work with my django site so that it will replace the SMTP server of my host. I configured my domain within my webhost's config panel. As a result, when I send an email to [email protected], I can see that it successfully comes though to the Google Account, which is great.
My application is setup to send out a confirmation email after someone tries to register.
I've completed what I believe to be all of the required steps to setup G Suite with my django project, but I still get an error when my project attempts to send out the confirmation email after someone registers. Specifically, I'm seeing the following on the Django error page:
SMTPServerDisconnected at /access/register/ Connection unexpectedly closed
I've completed the following steps:
1.I've setup the SMTP relay service (https://support.google.com/a/answer/2956491), which means I've:
2.In my django settings files, I'm using the following settings:
EMAIL_HOST = 'smtp-relay.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = '********'
DEFAULT_FROM_EMAIL = '[email protected]'
SERVER_EMAIL = '[email protected]'
EMAIL_PORT = 465
EMAIL_USE_TLS = False
I should also mention that with the following settings, my app was able to send out validation emails following registration with the webhost's SMTP server before I started down the path of implementing G Suite, so that I know that that part of the app works.
EMAIL_HOST = 'smtp.mywebhost.com'
EMAIL_HOST_USER = 'admin'
EMAIL_HOST_PASSWORD = '*****'
DEFAULT_FROM_EMAIL = '[email protected]'
SERVER_EMAIL = '[email protected]'
EMAIL_PORT = 25
EMAIL_USE_TLS = False
I'm pretty certain I'm missing something on the G Suite configuration side and I was hoping that you could help.
Thanks!
Accoding to the documentation of GSuite here : https://support.google.com/a/answer/2956491
If you are using "EMAIL_USE_TLS=False" then you will have to use some other authentication for the SMTP server like "IP Address Authentication".
If you do not setup the IP address filter in GSuite settings, your connection will the "unexpectedly closed".
Please try the point no 8 in the help page link above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With