A
A
Andrey Salnikov2016-06-03 09:04:35
Django
Andrey Salnikov, 2016-06-03 09:04:35

Why does send_email hang?

EMAIL_HOST = 'smtp.yandex.ru'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = '***'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
SERVER_EMAIL = EMAIL_HOST_USER
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER

Registered here such config.
send_mail('Subject here', 'Here is the message.', '[email protected]',
              ['[email protected]'])

Here is the function that starts the mail. So. It just freezes for me and gives a 504 timeout at the end. The site is hosted by Locum, no domain yet. I don't know if it matters or not.
Why does it freeze? After all, the configs seem to be correct. At the same time, I tried and through gmail it also hangs and that's it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2016-06-03
@Shshzik

EMAIL_USE_TLS = True замените на EMAIL_USE_SSL = True
Плюс порт не правильно стоит :
Исходящая почта
адрес почтового сервера — smtp.yandex.ru;
защита соединения — SSL;
порт — 465.
587 замените на 465

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question