语法高亮,滚动条美化,设置页面调整

This commit is contained in:
fofolee
2019-04-19 02:41:09 +08:00
parent 1e8f76c000
commit 359d29ee0b
1590 changed files with 12328 additions and 11441 deletions

View File

@@ -3,9 +3,9 @@
<h2 id="补充说明">补充说明</h2>
<p><strong>mail命令</strong> 是命令行的电子邮件发送和接收工具。操作的界面不像elm或pine那么容易使用但功能非常完整。</p>
<h3 id="语法">语法</h3>
<pre><code>mail(选项)(参数)</code></pre>
<pre><code class="language-bash">mail(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code>-b&lt;地址&gt;:指定密件副本的收信人地址;
<pre><code class="language-bash">-b&lt;地址&gt;:指定密件副本的收信人地址;
-c&lt;地址&gt;:指定副本的收信人地址;
-f&lt;邮件文件&gt;:读取指定邮件文件中的邮件;
-i不显示终端发出的信息
@@ -19,24 +19,24 @@
<p>邮件地址:收信人的电子邮箱地址。</p>
<h3 id="实例">实例</h3>
<p><strong>直接使用shell当编辑器</strong></p>
<pre><code>mail -s &quot;Hello from jsdig.com by shell&quot; admin@jsdig.com
<pre><code class="language-bash">mail -s &quot;Hello from jsdig.com by shell&quot; admin@jsdig.com
hello,this is the content of mail.
welcome to www.jsdig.com</code></pre>
<p>第一行是输入的命令,<code>-s</code>表示邮件的主题,后面的<code>admin@jsdig.com</code>则是邮件的接收人,输入完这行命令后回车,会进入邮件正文的编写,我们可以输入任何文字,比如上面的两行。当邮件正文输入完成后,需要按 <strong>CTRL+D</strong> 结束输入此时会提示你输入Cc地址即邮件抄送地址没有直接回车就完成了邮件的发送。</p>
<p><strong>使用管道进行邮件发送</strong></p>
<pre><code>echo &quot;hello,this is the content of mail.welcome to www.jsdig.com&quot; | mail -s &quot;Hello from jsdig.com by pipe&quot; admin@jsdig.com</code></pre>
<pre><code class="language-bash">echo &quot;hello,this is the content of mail.welcome to www.jsdig.com&quot; | mail -s &quot;Hello from jsdig.com by pipe&quot; admin@jsdig.com</code></pre>
<p>使用管道直接敲入这行命令即可完成邮件的发送其中echo后的是邮件正文。</p>
<p><strong>使用文件进行邮件发送</strong></p>
<pre><code>mail -s &quot;Hello from jsdig.com by file&quot; admin@jsdig.com &lt; mail.txt</code></pre>
<pre><code class="language-bash">mail -s &quot;Hello from jsdig.com by file&quot; admin@jsdig.com &lt; mail.txt</code></pre>
<p>使用上面的命令后我们就可以把mail.txt文件的内容作为邮件的内容发送给admin@jsdig.com了。</p>
<p>使用上述三种方式都可以给外部邮箱进行邮件发送但因为前面2中都是直接在shell中敲入邮件内容因此无法输入中文即使我们使用粘贴的方式输入了中文那么收到的邮件也是乱码的。但第3种方式我们可以在window下编辑好邮件内容后放到linux下再进行发送这样就可以正常发送中文了。不过目前邮件的中文标题暂时没有找到解决办法。</p>
<p>因为mail程序本身就是调用sendmail来进行邮件发送的因此我们可以在mail命令中使用sendmail的参数进行配置比如我想使用特定的发件人发送邮件可以使用如下命令</p>
<pre><code>mail -s &quot;Hello from jsdig.com with sender&quot; admin@jsdig.com -- -f user@jsdig.com&lt;mail.txt</code></pre>
<pre><code class="language-bash">mail -s &quot;Hello from jsdig.com with sender&quot; admin@jsdig.com -- -f user@jsdig.com&lt;mail.txt</code></pre>
<p>上面的命令中,我们使用了– -f user@jsdig.com这样的参数这是sendmail的选项其中-f表示邮件的发送人邮件地址。</p>
<p>很多情况下我们也需要使用邮件来发送附件在linux下使用mail命令发送附件也很简单不过首先需要安装uuencode软件包这个程序是对二进制文件进行编码使其适合通过邮件进行发送在CentOS上安装该软件包如下</p>
<pre><code>yum install sharutils</code></pre>
<pre><code class="language-bash">yum install sharutils</code></pre>
<p>安装完成后我们就可以来进行附件的发送了,使用如下命令:</p>
<pre><code>uuencode test.txt test | mail -s &quot;hello,see the attachement&quot; admin@jsdig.com&lt;mail.txt</code></pre>
<pre><code class="language-bash">uuencode test.txt test | mail -s &quot;hello,see the attachement&quot; admin@jsdig.com&lt;mail.txt</code></pre>
<p>完成后就可以把text.txt文件作为邮件的附件发送出去了。uuencode有两个参数第一个是要发送的文件第二个是显示的文件名称。</p>
<p>这里我主要介绍的是在CentOS下使用mail发送电子邮件的一些使用方法需要的要求是你的linux必须安装了sendmail并开启了同时保证可以连接外网。另外文章中提到的命令本人都经过亲自测试保证完全可用不过你需要将命令中的电子邮件地址换成自己的电子邮件地址。</p>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->