Step 1. Install SMTP
run the command in your terminal
Kode: Vælg alt
sudo apt-get install ssmtp
Step 2. Configure SMTP
We are gonna open the SMTP config file and add the content below in the end line.
Copy the content below
Kode: Vælg alt
Root=your_email@gmail.com
Mailhub=smtp.gmail.com:465
RewriteDomain=gmail.com
AuthUser=your_gmail_username # (before the @gmail.com part)
AuthPass=your_gmail_password
FromLineOverride=Yes
UseTLS=Yes
Open config file and paste the content in the end line
Kode: Vælg alt
sudo nano /etc/ssmtp/ssmtp.conf
Step 2. Test SMTP
to test our SMTP we are gonna download send mail client
Kode: Vælg alt
sudo apt-get install heirloom-malix -y
try to send a mail with this command
Kode: Vælg alt
echo testing|mail -s ‘Test Mail’
http://techknight.eu/send-mail-witg-google-smtp-ubuntu-14-04/