Hi I finished making my contact form but it doesn’t let me send email, I’m using mailtrap as a test server but I get an error. I’m using Django 5.0 and Python 3.10
Settings.py
# Email config
EMAIL_HOST = 'sandbox.smtp.mailtrap.io'
EMAIL_HOST_USER = '811387a3996524'
EMAIL_HOST_PASSWORD = '********6d43'
EMAIL_PORT = '2525'
Error message
SMTPServerDisconnected at /contact/
Connection unexpectedly closed
Request Method: POST
Request URL: http://127.0.0.1:8000/contact/
Django Version: 5.0.4
Exception Type: SMTPServerDisconnected
Exception Value:
Connection unexpectedly closed
Exception Location: /usr/lib/python3.10/smtplib.py, line 405, in getreply
Raised during: contact.views.contact
Python Executable: /home/andres/.local/share/virtualenvs/CursoDjango-IwbI9JP5/bin/python
Python Version: 3.10.12
Python Path:
[‘/home/andres/Escritorio/CursoDjango/webempresa’,
‘/usr/lib/python310.zip’,
‘/usr/lib/python3.10’,
‘/usr/lib/python3.10/lib-dynload’,
‘/home/andres/.local/share/virtualenvs/CursoDjango-IwbI9JP5/lib/python3.10/site-packages’]
Server time: Fri, 17 May 2024 22:26:46 +0000