How I can send a simple mail from Ubuntu command line without giving the password for the email account which I'm sending to?
-
If the question below worked, be sure to accept it by toggling the grey tick just beneath the answer's downvote button– TellMeWhyNov 26, 2015 at 10:23
-
"The password for the account you're sending to"? No mail service asks the target account's password. O.o– muruNov 26, 2015 at 10:27
-
@muru I think OP meant "without password for the email account I'm using"?– TellMeWhyNov 26, 2015 at 10:29
-
1@DevRobot That's what I think too. But I wonder if they used some command which asked for some password which they mistook for the target account's pw.– muruNov 26, 2015 at 10:31
Add a comment
|
2 Answers
sudo apt-get install mailutils
mail -s "Subject" [email protected]
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.
-
On 14.04, at least you must install the package
mailutils
first: The program 'mail' is currently not installed. You can install it by typing:sudo apt-get install mailutils
Nov 26, 2015 at 9:34
echo "Mail text" | mail -s "Subject" [email protected]
-
-
3sending mail whithout text typing, can do some nice things like df -h | mail -s "Disk Info" [email protected], redirect logs to your email sudo cat /var/log/syslog | mail -s "logs" [email protected]. Just a suggestion...– shamskyNov 26, 2015 at 11:13