Hey, i am trying to setup SMTP as well but i cannot get it to work for the life of me.
i followed your instructions and these are the outputs:
Results with TLS:
command:
python manage.py test_emails kees.rodriguez@gmail.com
result:
Traceback (most recent call last):
File "/taiga-back/manage.py", line 17, in <module>
execute_from_command_line(sys.argv)
File "/opt/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/opt/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/venv/lib/python3.11/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/venv/lib/python3.11/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/taiga-back/taiga/base/management/commands/test_emails.py", line 48, in handle
email.send()
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/message.py", line 284, in send
return self.get_connection(fail_silently).send_messages([self])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 102, in send_messages
new_conn_created = self.open()
^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 69, in open
self.connection.login(self.username, self.password)
File "/usr/local/lib/python3.11/smtplib.py", line 716, in login
raise SMTPNotSupportedError(
smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.
command:
from django.core.mail import send_mail
send_mail("subject", "body", "kreativekompas@gmail.com", ["kees.rodriguez@gmail.com"])
result:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/code.py", line 90, in runcode
exec(code, self.locals)
File "<console>", line 1, in <module>
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/__init__.py", line 61, in send_mail
return mail.send()
^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/message.py", line 284, in send
return self.get_connection(fail_silently).send_messages([self])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 102, in send_messages
new_conn_created = self.open()
^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 69, in open
self.connection.login(self.username, self.password)
File "/usr/local/lib/python3.11/smtplib.py", line 716, in login
raise SMTPNotSupportedError(
smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.
Results with SSL:
command:
python manage.py test_emails kees.rodriguez@gmail.com
result:
Traceback (most recent call last):
File "/taiga-back/manage.py", line 17, in <module>
execute_from_command_line(sys.argv)
File "/opt/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/opt/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/venv/lib/python3.11/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/venv/lib/python3.11/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/taiga-back/taiga/base/management/commands/test_emails.py", line 48, in handle
email.send()
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/message.py", line 284, in send
return self.get_connection(fail_silently).send_messages([self])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 102, in send_messages
new_conn_created = self.open()
^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 62, in open
self.connection = self.connection_class(self.host, self.port, **connection_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/smtplib.py", line 255, in __init__
(code, msg) = self.connect(host, port)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/smtplib.py", line 343, in connect
(code, msg) = self.getreply()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/smtplib.py", line 405, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed
command:
from django.core.mail import send_mail
send_mail("subject", "body", "kreativekompas@gmail.com", ["kees.rodriguez@gmail.com"])
result:
send_mail("subject","body","kreativekompas@gmail.com",["kees.rodriguez@gmail.com"])
Traceback (most recent call last):
File "/usr/local/lib/python3.11/code.py", line 90, in runcode
exec(code, self.locals)
File "<console>", line 1, in <module>
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/__init__.py", line 61, in send_mail
return mail.send()
^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/message.py", line 284, in send
return self.get_connection(fail_silently).send_messages([self])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 102, in send_messages
new_conn_created = self.open()
^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 62, in open
self.connection = self.connection_class(self.host, self.port, **connection_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/smtplib.py", line 255, in __init__
(code, msg) = self.connect(host, port)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/smtplib.py", line 343, in connect
(code, msg) = self.getreply()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/smtplib.py", line 405, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed
i use the settings provided from google: Send email from a printer, scanner, or app - Google Workspace Admin Help
and it works with other apps.
this is what is in my .env file:
# Taiga's SMTP settings - Variables to send Taiga's emails to the users
EMAIL_BACKEND=smtp # use an SMTP server or display the emails in the console (either "smtp" or "console")
EMAIL_HOST=smtp.gmail.com # SMTP server address
EMAIL_PORT=587 # default SMTP port
EMAIL_HOST_USER=kreativekompas@gmail.com # user to connect the SMTP server
EMAIL_HOST_PASSWORD=PASSWORD # SMTP user's password
EMAIL_DEFAULT_FROM=kreativekompas@gmail.com # default email address for the automated emails
# EMAIL_USE_TLS/EMAIL_USE_SSL are mutually exclusive (only set one of those to True)
EMAIL_USE_TLS=true # use TLS (secure) connection with the SMTP server
EMAIL_USE_SSL=false # use implicit TLS (secure) connection with the SMTP server
console works fine but smtp does not do anything. or i dont know if i have to rebuild the docker image from scratch with these settings to make it work.
anybody has an idea?