3

How I can send a simple mail from Ubuntu command line without giving the password for the email account which I'm sending to?

muru
  • 207,228
Ken
  • 41

2 Answers2

4
sudo apt-get install mailutils
mail -s "Subject" email@email.com

Press enter and write the subject of your email. Use Ctrl+D to continue.

You will be asked if you want to mark a copy of the mail to any other address - you can skip that with Ctrl+D.

The email will now be sent to your chosen address.

TellMeWhy
  • 17,964
  • 41
  • 100
  • 142
4
echo "Mail text" | mail -s "Subject" your@mail.com
muru
  • 207,228
shamsky
  • 104