# Set default values for all following accounts.
defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log
# Gmail
account gmail
host smtp.gmail.com
port 587
from [email protected]
user myuser
password mypass
# Set a default account
account default : gmail
$ echo "Message content" | mail -s "Subject" [email protected]
$ mail -s "Subject" -a file.tar.gz [email protected] < /dev/null
$ curl https://example.com | mail -M "text/html" -s "Subject" [email protected]