snipt

Ctrl+h for KB shortcuts

Bash

command line mail

1
2
3
4
5
6
sudo aptitude install mailx
sudo echo "smtp.comcast.com mailhost" >> /etc/hosts
echo "blah" | mail -s test [email protected]

sudo aptitude install sharutils
cat myFile.txt | uuencode myAttachment.bash | mail -s mySubject [email protected]
https://snipt.net/embed/a60a241107de50b8e6d3fbd576b2a36c/
/raw/a60a241107de50b8e6d3fbd576b2a36c/
a60a241107de50b8e6d3fbd576b2a36c
bash
Bash
7
2019-05-24T02:21:06
True
False
False
/api/public/snipt/5695/
command-line-mail
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>sudo aptitude install mailx </span><span id="L-2"><a name="L-2"></a>sudo <span class="nb">echo</span> <span class="s2">&quot;smtp.comcast.com mailhost&quot;</span> &gt;&gt; /etc/hosts </span><span id="L-3"><a name="L-3"></a><span class="nb">echo</span> <span class="s2">&quot;blah&quot;</span> <span class="p">|</span> mail -s <span class="nb">test</span> [email protected] </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>sudo aptitude install sharutils </span><span id="L-6"><a name="L-6"></a>cat myFile.txt <span class="p">|</span> uuencode myAttachment.bash <span class="p">|</span> mail -s mySubject [email protected] </span></pre></div> </td></tr></table>
email, mail