⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 632-634.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Special Edition Using Linux, Fourth Edition:Using Electronic Mail</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0789717468//-->

<!--TITLE=Special Edition Using Linux, Fourth Edition//-->

<!--AUTHOR=Jack Tackett//-->

<!--AUTHOR=Jr.//-->

<!--AUTHOR=Steve Burnett//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Que//-->

<!--CHAPTER=33//-->

<!--PAGES=632-634//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="629-632.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="634-636.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H3><A NAME="Heading3"></A><FONT COLOR="#000077">Sending E-Mail with <I>mail</I>

</FONT></H3>

<P>You can send e-mail to an individual, a group of individuals, or a mailing list. Just as when you want to send a paper letter, you must specify the address of the recipient with e-mail. Sometimes, you&#146;ll compose or write a message while you&#146;re sending e-mail; at other times, you&#146;ll send a prepared message; you may even send the output of a command or program with e-mail. When using <TT>mail</TT> or <TT>elm</TT>, the message you send has to be a text file&#151;that is, an ASCII file.</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B>The Simple Mail Transport Protocol (SMTP) is used to transfer mail between computers. It now supports only ASCII files. To send a binary file via e-mail, you have to convert the file to ASCII by using the <TT>uuencode</TT> utility.<HR></FONT>

</BLOCKQUOTE>

<P>Regardless of how the message is prepared, you send mail by using a command of the following form:

</P>

<!-- CODE SNIP //-->

<PRE>

<B>mail</B> address

</PRE>

<!-- END CODE SNIP //-->

<P>This command starts the <TT>mail</TT> system. You can then compose the mail message and send it to the specified address. In this syntax, <TT><I>address</I></TT> is the e-mail address of the person who is to receive the message. An address can have several different forms. To send e-mail to someone who has a login ID on the machine you&#146;re using, use the login ID of that person. For example, to send e-mail to someone on your system whose login name is george, enter the following command:</P>

<!-- CODE SNIP //-->

<PRE>

<B>mail george</B>

</PRE>

<!-- END CODE SNIP //-->

<P>If george is on another system that you can access through some network or collection of networks, you must include the name by which that system is known on the network. Suppose that george is the name of a user on a computer system whose network name is apples.startup.com. You can send e-mail by entering this command:

</P>

<!-- CODE SNIP //-->

<PRE>

<B>mail george@apples.startup.com</B>

</PRE>

<!-- END CODE SNIP //-->

<P>The exact form of the address depends on the type of network being used and any local conventions or rules. Ask a local expert or your system administrator about the form of addresses on a network in your company.

</P>

<P>To send the same message to several users, include each of their addresses on the line with the <TT>mail</TT> command, as in this example:</P>

<!-- CODE SNIP //-->

<PRE>

<B>mail fred bill george@apples.startup.com</B>

</PRE>

<!-- END CODE SNIP //-->

<H4 ALIGN="LEFT"><A NAME="Heading4"></A><FONT COLOR="#000077">Writing a Message While Sending E-Mail</FONT></H4>

<P>Many users compose or write messages while they&#146;re in the e-mail program, rather than compose a message beforehand. This is usually the quickest&#151;but not the neatest&#151;way to send mail. It&#146;s not neat because you have limited editing capabilities while composing your message. Generally, you can deal with only one line at a time. First, you type the command to send e-mail, specify the address(es), and then press &lt;Return&gt;. Then you type the message, indicating that you&#146;re done by typing a period on a line by itself. You can also use &lt;Ctrl-d&gt; to end the message. For an example of how to send e-mail to a user named lynn, enter this command to start the mail system and specify lynn&#146;s address on your system:

</P>

<!-- CODE SNIP //-->

<PRE>

<B>mail lynn</B>

Subject: <B>Congratulations! Lunch Thursday?</B>

</PRE>

<!-- END CODE SNIP //-->

<P>Now type the message, pressing &lt;Return&gt; when you want to end a line. Here&#146;s a sample message that you may want to send to lynn (press &lt;Return&gt; at the end of each line to space the paragraphs of the message):

</P>

<!-- CODE //-->

<PRE>

<B>Lynn,</B>



<B>Just wanted to tell you that I thought you did a great</B>

<B>job at the meeting yesterday! It seems as if we&#146;re</B>

<B>finally turning this problem around.</B>



<B>Want to get together for lunch Thursday?</B>

<B>Give me a call.</B>

<B>joe</B>

<B>.</B>

</PRE>

<!-- END CODE //-->

<P>You can also end the message with &lt;Ctrl-d&gt; instead of a period. The computer responds by displaying <TT>EOT</TT>, which means <I>end of transmission</I>.</P>

<H4 ALIGN="LEFT"><A NAME="Heading5"></A><FONT COLOR="#000077">Canceling a Message</FONT></H4>

<P>You can cancel a message while you&#146;re writing it, but you can&#146;t cancel it after it&#146;s sent. To cancel a message while you&#146;re writing it, press whatever key is configured on your system as the interrupt key (usually &lt;Ctrl-c&gt; or &lt;Del&gt;). When a message is canceled, it&#146;s saved in a file named dead.letter. You can delete this file or edit it later for another message. When using mail, you must press &lt;Ctrl-c&gt; twice to cancel (in case you press &lt;Ctrl-c&gt; or &lt;Del&gt; by mistake). After canceling your mail message, you see the command-line prompt. The following example shows how the cancel function works:

</P>

<!-- CODE SNIP //-->

<PRE>

<B>mail lynn</B>

Subject: <B>Congratulations! Lunch Thursday?</B>

<B>Lynn,</B>



<B>Just wanted to tell that I thought you did a great</B>

<B>job</B>&lt;Ctrl-c&gt;

 (Interrupt -- one more to kill letter)

</PRE>

<!-- END CODE SNIP //-->

<P>You now must decide whether you want to continue the letter or kill it. If you decide to continue, you just keep typing the text of the letter as follows:

</P>

<!-- CODE SNIP //-->

<PRE>

<B>at the meeting yesterday! It seems as if we&#146;re finally</B>

<B>turning this problem around.</B>

</PRE>

<!-- END CODE SNIP //-->

<P>At this point, you decide to cancel the letter again, so you press &lt;Ctrl-c&gt; or &lt;Del&gt;. The system responds with <TT>(Interrupt -- one more to kill letter)</TT>. Because you want to kill the message, press &lt;Ctrl-c&gt; or &lt;Del&gt; a second time; <TT>mail</TT> quits, and you see the shell prompt.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="629-632.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="634-636.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -