Tell me how I can send an email to the mailbox on the local server. Django works on localhost: 8080 to send (as read in the documentation) you need an SMTP server. I also run local

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

I receive localhost: 1025 in a vyy

 send_mail('theme', 'my messege', 'admins@studio.ru', ['a@a.ru']) 

caught various errors, for example with getaddrinfo (host, port) added to the view

 import socket socket.getaddrinfo('localhost', 8080) 

now error [Errno 11004] getaddrinfo failed

 (code, msg) = self.connect(host, port) 

I don’t know how to tune (newbie) at all and wrote in the settings:

 EMAIL_HOST = 'localhost:8080' EMAIL_HOST_USER = 'username@domain.ru' EMAIL_HOST_PASSWORD = '' EMAIL_PORT = 1025 

u true to the setting problem. Tell me how to set everything up correctly?

    1 answer 1

    For development, the one-line solution suits me. All sent letters will be simply displayed in the console (stdout).

     EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' 

    If you still need to configure the mail through the sending server. We start the pitonovsky mailer

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

    In the application settings file

     EMAIL_HOST = 'localhost' EMAIL_PORT = 1025 

    Everything :)

    More details: