Answer the question
In order to leave comments, you need to log in
How to send email via SMTP in Django?
I'm using Django==2.1.3.
Set up the project to send emails via smtp
EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend'
EMAIL_HOST = 'smtp.mail.ru'
EMAIL_PORT = 465
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'my_password'
send_mail(
'Тема письма важная',
'Данное сообщение отправленно потому что я проверяю как работает отправка письем из джанги. ЧТобы прикрутить ее для своего проекта',
'[email protected]',
['[email protected]'],
fail_silently=False,
)
Answer the question
In order to leave comments, you need to log in
You probably have hosting) at least minimal. Create a mailbox there and fill in the necessary parameters in the documentation . Here it works not beget.ru
EMAIL_HOST = "smtp.beget.com"
EMAIL_HOST_USER = "[email protected]"
EMAIL_HOST_PASSWORD = "&*R5mVWt"
EMAIL_PORT = 465
EMAIL_USE_SSL = True
SERVER_EMAIL = "[email protected]"
DEFAULT_FROM_EMAIL = "[email protected]"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question