sending mails via commandline
- August 3rd, 2007
- linux, Snippet-library
Sometimes its useful to send a small reminder, note or even a whole file from the commandline in linux. This is how it goes.
<p>Sometimes its useful to send a small reminder, note or even a whole file from the commandline in linux. This is how it goes.</p> <p>To send just a simple message type:</p> <code class="prettyprint"> echo "e-mail body" | mail -s "e-mail subject" mail@example.com </code> <p>If you want to send a file type:</p> <code class="prettyprint"> echo "e-mail body" | mail -a /full/path/to/file -s "e-mail subject" mail@example.com </code>
















Submit your comment