Published on

Sending Mail with SSMTP on Alpine Linux

Authors

Quick Post on how to use ssmtp on Alpine Linux to Send Mail:

Update and Install SSMTP

$ apk update
$ apk add ssmtp

Configure SSMTP

$ cat > /etc/ssmtp/ssmtp.conf << EOF
root=postmaster
mailhub=mail.domain.com:25
hostname=`hostname`
FromLineOverride=YES
EOF

Create the Mail Content

$ cat > mail.txt << EOF
To: recipient@domain.com
From: sender@domain.com
Subject: Mail with SSMTP

Hello, this is a test mail.
EOF

Testing Mail Delivery

$ ssmtp recipient@domain.com < file.txt

Thank You

Thanks for reading, feel free to check out my website, feel free to subscribe to my newsletter or follow me at @ruanbekker on Twitter.