Files
notes/divers/send_TLS_email_from_Linux_bash_01.md
2026-03-13 11:14:48 +01:00

556 B

How to send an email from Linux in command line using a TLS SMTP server

Configure msmtp for TLS

Install msmtp:

dnf install msmtp

Create /etc/msmtprc:

defaults
auth           on
tls            on
tls_trust_file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
logfile        /var/log/msmtp.log

account default
host smtp.orange.fr
port 587
from plesnila.valeriu@orange.fr
user plesnila.valeriu@orange.fr
password "*****"

Test:

printf "Subject: Test Email\n\nThis is a test email." | msmtp -v vplesnila@gmail.com