Y
Y
Yaroslav Ogloblin2019-06-26 10:38:04
Django
Yaroslav Ogloblin, 2019-06-26 10:38:04

Why doesn't sending mail via send_mail() work?

Good afternoon.
I'm trying to use a Yandex mailbox to send mail to the site admin about orders made.
Versions:
Python==2.7
Django==1.8 I
use native function send_mail()and standard backend for this.
In settings:

EMAIL_HOST = 'smtp.yandex.ru'
EMAIL_PORT = 465
EMAIL_HOST_USER = 'username'
EMAIL_HOST_PASSWORD = 'userpassword'
EMAIL_USE_SSL = True

Initially it was:
EMAIL_HOST_USER = '[email protected]'
But I read that if the box is on the Yandex domain, then @yandex.ruyou do not need to specify it.
When sending a letter, the process freezes for 15-20 minutes, then it gives out:
error: [Errno 101] Network is unreachable
Google, all I found is that the reason is in the blocked port 25, it is really blocked on the server. But he's not needed, I'm not going to receive mail, just send it.
What could be the reasons and how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-06-26
@savao

The error "Network is unreachable" means that traffic from your server to smtp.yandex.ru does not go. The reasons may be in the firewall of your server, in blocking your server by Yandex networks, in the absence of routing between them, etc. etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question