S
S
SpectreZ2022-04-06 17:55:15
SMTP
SpectreZ, 2022-04-06 17:55:15

How to set up a connection to yandex SMTP on the server?

On the vps server, it is not possible to configure mail sending via smtp.yandex.ru. When trying to send using PHP Mailer, the following log is displayed:

2022-04-06 14:32:53 Connection: opening to ssl://smtp.yandex.ru:465, timeout=300, options=array()
2022-04-06 14:32:54 Connection failed. Error #2: stream_socket_client(): Peer certificate CN=`relay.v.fozzy.com' did not match expected CN=`smtp.yandex.ru'
2022-04-06 14:32:54 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto
2022-04-06 14:32:54 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.yandex.ru:465 (Unknown error)
2022-04-06 14:32:54 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting


A connection to smtp.yandex.ru is established via telnet:

telnet smtp.yandex.ru 465
Trying 77.88.21.158...
Connected to smtp.yandex.ru.
Escape character is '^]'.


After entering any command via telnet, the message "Connection closed by foreign host."

The connection settings (login, password) are correct, with the same settings mail is sent from another server. Identical problem on several sites on this server.

Apparently, the problem is related to SSL. I met a question here with a similar situation https://qna.habr.com/q/779169 . When the command var_dump(fsockopen("ssl://smtp.yandex.ru",465));is executed , bool(false).

Perhaps someone else has encountered a similar problem? What could be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yakov, 2022-04-06
Svetsky @jamessvetsky

Perhaps this article will help
https://7fk.ru/nastroyka-smtp/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question