Avatar ·

Django. Sending Email to Localhost

📁 Advanced Python Topics, Error, example, AI, debug, work

Tell me how I can send an email to a mailbox on a local server. Django runs on localhost:8080. For sending (as I read in the documentation) you need an SMTP server. I also launch a local one

python -m smtpd -n -c DebuggingServer localhost: 1025

I get localhost:1025 in view

send_mail('Subject', 'my message', 'admins@studio.ru', ['@a.ru'])

I caught different errors, for example with getaddrinfo(host, port) added to the mess