Jan 17 2026

Sending email without mail server – msmtp (light SMTP client)

apt install msmtp msmtp-mta

Config file /etc/msmtprc


defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /var/log/msmtp.log
account default
host smtp.gmail.com
port 587
from twojemail@gmail.com
user twojemail@gmail.com
password "<secret>"

chmod 600 /etc/msmtprc
Test
echo "Test msmtp" | mail -s "Test" someone@gmail.com
Logs
tail -f /var/log/msmtp.log

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.