Sending mail using msmtp

Sending mail through the terminal.

apt-get install msmtp -y

vim ~/.msmtprc

account my_yandex
logfile /var/log/msmtp.log
host smtp.yandex.ru
port 465
from <адрес>
keepbcc on
auth on
user <адрес>
password <пароль>
tls on
tls_starttls off
tls_certcheck off

Send email:

echo -e "Subject: Test SMTP\nTo: send_email@domain.com\nTest message body" | msmtp -a my_yandex send_email@domain.com