Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 799 Bytes

email.md

File metadata and controls

43 lines (33 loc) · 799 Bytes

E-mail

Send e-mails from command line

  1. Install msmtp and s-nail
  2. Configure ~/.msmtprc
# 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
  1. Send mail
$ echo "Message content" | mail -s "Subject" [email protected]

Send attachments

$ mail -s "Subject" -a file.tar.gz [email protected] < /dev/null

Send HTML

$ curl https://example.com | mail -M "text/html" -s "Subject" [email protected]