I am looking to be able to send emails via the command line.
I looked at mail and sendmail, but could not figure out how to configure them.
It looked complex.
I am looking to be able to send emails via the command line.
I looked at mail and sendmail, but could not figure out how to configure them.
It looked complex.
Install ssmtp;
sudo apt-get install ssmtp
Edit the ssmtp config file:
gksu gedit /etc/ssmtp/ssmtp.conf
Append the following text:
[email protected]
mailhub:465=smtp.gmail.com
rewriteDomain=gmail.com
AuthUser=username
AuthPass=password
FromLineOverride=YES
UseTLS=YES
Run ssmtp and provide the recipient email address:
ssmtp [email protected]
Provide the message details as follows:
To: [email protected]
From: [email protected]
Subject: Sent from a terminal!
Your content goes here. Lorem ipsum dolor sit amet, consectetur adipisicing.
(Notice the blank space between the subject and the body.)
Press Ctrl + D to send.
I do not use gmail, I use yahoo mail.
Thanks steve. I got it to work.
Now to figure out how to schedule the email ahead of time.