Rāda ziņas ar etiķeti mail. Rādīt visas ziņas
Rāda ziņas ar etiķeti mail. Rādīt visas ziņas

sestdiena, 2013. gada 12. janvāris

bash script to send mail via SMTP

Download and install msmtp

Create .msmtprc with following lines:
account default
host smtp.gmail.com
port 587
from me@gmail.com
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth on
user me@gmail.com
password gmailpassword
logfile ~/.msmtp


$ chmod 600 ~/.msmtp


$ msmtp -t < somefile

First lines of 'somefile' should be header info such as To:, From:, Subject:.