R
R
rusyska550112021-09-14 16:46:43
Django
rusyska55011, 2021-09-14 16:46:43

Do not log in to mail.ru account to send emails via SMTP Django3?

Code in views.py

from django.conf import settings
from django.core.mail import send_mail
send_mail('Заголовок письма', 'Текст письма', settings.EMAIL_HOST_USER, ['почта@yandex.ru'], auth_user=settings.EMAIL_HOST_USER, auth_password=settings.EMAIL_HOST_PASSWORD)

Code in settings.py:
EMAIL_HOST = 'smtp.mail.ru'
EMAIL_PORT = 465
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'пароль'
EMAIL_USE_TLS = False
EMAIL_USE_SSL = True

Server response:
6140a84668690327646297.jpeg

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question