Tietokoneiden näyttöjä, joissa näkyy kuvaa automaatiolaboratorion laitteistosta. Monitoreiden takana näkyy sama laitteisto kuin kuvissa.

timohei.net / My Courses / Project on Intelligent Device / ???/
sstmp

To install, type the following commands:

sudo apt-get update
sudo apt-get install ssmtp
sudo apt-get install mailutils

Edit configuration file to match your email settings:

sudo pico /etc/ssmtp/ssmtp.conf

If you use Gmail address, update the file with the following settings:

AuthUser=your_username@gmail.com
AuthPass=your-gmail-password
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES

If you choose to use University's address, update the file with following settings:

AuthUser=your_username@students.oamk.fi
AuthPass=your-password
FromLineOverride=YES
mailhub=smtp.office365.com:587
UseSTARTTLS=YES

Disable Sendmail:

sudo service sendmail stop
sudo chkconfig sendmail off
sudo mkdir /root/.sendmail_bu
sudo mv /usr/sbin/sendmail /root/.sendmail_bu
sudo ln -s /usr/local/ssmtp/sbin/ssmtp /usr/sbin/sendmail
Now, you can use mail / mailx command to send email messages. You can also write a shell script to backup your files and email to somewhere else (see below). You can test settings using following syntax:

echo "This is a test" | mail -s "Test" timohei@oamk.fi
Updated 15.11.2020

© Timo Heikkinen | timo piste heikkinen at oamk piste fi