001: @c This is part of the Emacs manual.
002: @c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2019 Free Software
003: @c Foundation, Inc.
004: @c See file emacs.texi for copying conditions.
005: @node Sending Mail
006: @chapter Sending Mail
007: @cindex sending mail
008: @cindex mail
009: @cindex email
010: @cindex message
011: 
012: @kindex C-x m
013: @findex compose-mail
014:   To send an email message from Emacs, type @kbd{C-x m}.  This
015: switches to a buffer named @file{*unsent mail*}, where you can edit
016: the text and headers of the message.  When done, type @kbd{C-c C-s} or
017: @kbd{C-c C-c} to send it.
018: 
019: @table @kbd
020: @item C-x m
021: Begin composing mail (@code{compose-mail}).
022: @item C-x 4 m
023: Likewise, in another window (@code{compose-mail-other-window}).
024: @item C-x 5 m
025: Likewise, but in a new frame (@code{compose-mail-other-frame}).
026: @item C-c C-s
027: In the mail buffer, send the message (@code{message-send}).
028: @item C-c C-c
029: In the mail buffer, send the message and bury the buffer
030: (@code{message-send-and-exit}).
031: @end table
032: 
033:   The mail buffer is an ordinary Emacs buffer, so you can switch to
034: other buffers while composing the mail.  If you want to send another
035: mail before finishing the current one, type @kbd{C-x m} again to open
036: a new mail buffer whose name has a different numeric suffix
037: (@pxref{Misc Buffer}).  If you invoke the command with a prefix
038: argument, @w{@kbd{C-u C-x m}}, Emacs switches back to the last mail
039: buffer, and asks if you want to erase the message in that buffer; if
040: you answer no, this lets you pick up editing the message where you
041: left off.
042: 
043: @kindex C-x 4 m
044: @findex compose-mail-other-window
045: @kindex C-x 5 m
046: @findex compose-mail-other-frame
047:   The command @kbd{C-x 4 m} (@code{compose-mail-other-window}) does
048: the same as @kbd{C-x m}, except it displays the mail buffer in a
049: different window.  The command @kbd{C-x 5 m}
050: (@code{compose-mail-other-frame}) does it in a new frame.
051: 
052:   When you type @kbd{C-c C-c} or @kbd{C-c C-s} to send the mail, Emacs
053: may ask you how it should deliver the mail---either directly via SMTP,
054: or using some other method.  @xref{Mail Sending}, for details.
055: 
056: @menu
057: * Format: Mail Format.        Format of a mail message.
058: * Headers: Mail Headers.      Details of some standard mail header fields.
059: * Aliases: Mail Aliases.      Abbreviating and grouping mail addresses.
060: * Commands: Mail Commands.    Special commands for editing mail being composed.
061: * Signature: Mail Signature.  Adding a signature to every message.
062: * Amuse: Mail Amusements.     Distracting the NSA; adding fortune messages.
063: * Methods: Mail Methods.      Using alternative mail-composition methods.
064: @end menu
065: 
066: @node Mail Format
067: @section The Format of the Mail Buffer
068: 
069:   Here is an example of the contents of a mail buffer:
070: 
071: @example
072: To: subotai@@example.org
073: CC: mongol.soldier@@example.net, rms@@gnu.org
074: Subject: Re: What is best in life?
075: From: conan@@example.org
076: --text follows this line--
077: To crush your enemies, see them driven before you, and to
078: hear the lamentation of their women.
079: @end example
080: 
081: @noindent
082: At the top of the mail buffer is a set of @dfn{header fields}, which
083: are used for specifying information about the email's recipient(s),
084: subject, and so on.  The above buffer contains header fields for
085: @samp{To}, @samp{CC}, @samp{Subject}, and @samp{From}.  Some header
086: fields are automatically pre-initialized in the mail buffer, when
087: appropriate.
088: 
089:   The line that says @samp{--text follows this line--} separates the
090: header fields from the @dfn{body} (or @dfn{text}) of the message.
091: Everything above that line is treated as part of the headers;
092: everything below it is treated as the body.  The delimiter line itself
093: does not appear in the message actually sent.
094: 
095:   You can insert and edit header fields using ordinary editing
096: commands.  @xref{Header Editing}, for commands specific to editing
097: header fields.  Certain headers, such as @samp{Date} and
098: @samp{Message-Id}, are normally omitted from the mail buffer and are
099: created automatically when the message is sent.
100: 
101: @node Mail Headers
102: @section Mail Header Fields
103: @cindex headers (of mail message)
104: 
105:   A header field in the mail buffer starts with a field name at the
106: beginning of a line, terminated by a colon.  Upper and lower case are
107: equivalent in field names.  After the colon and optional whitespace
108: comes the contents of the field.
109: 
110:   You can use any name you like for a header field, but normally
111: people use only standard field names with accepted meanings.
112: 
113: @vindex user-full-name
114: @vindex user-mail-address
115:   The @samp{From} header field identifies the person sending the email
116: (i.e., you).  This should be a valid mailing address, as replies are
117: normally sent there.  The default contents of this header field are
118: computed from the variables @code{user-full-name} (which specifies
119: your full name) and @code{user-mail-address} (your email address).  On
120: some operating systems, Emacs initializes these two variables using
121: environment variables (@pxref{General Variables}).  If this
122: information is unavailable or wrong, you should customize the
123: variables yourself (@pxref{Easy Customization}).
124: 
125: @vindex mail-from-style
126:   The value of the variable @code{mail-from-style} specifies how to
127: format the contents of the @samp{From} field:
128: 
129: @table @asis
130: @item @code{nil}
131: Use just the address, as in @samp{king@@grassland.com}.
132: @item @code{parens}
133: Use both address and full name, as in:@*
134: @samp{king@@grassland.com (Elvis Parsley)}.
135: @item @code{angles}
136: Use both address and full name, as in:@*
137: @samp{Elvis Parsley <king@@grassland.com>}.
138: @item any other value
139: Use @code{angles} normally.  But if the address must be quoted to
140: remain syntactically valid under the @code{angles} format but not
141: under the @code{parens} format, use @code{parens} instead.  This is
142: the default.
143: @end table
144: 
145:   Apart from @samp{From}, here is a table of commonly-used fields:
146: 
147: @table @samp
148: @item To
149: The mailing address(es) to which the message is addressed.  To list
150: more than one address, use commas to separate them.
151: 
152: @item Subject
153: The subject of the message.
154: 
155: @item CC
156: Additional mailing address(es) to send the message to.  This is like
157: @samp{To}, except that these readers should not regard the message as
158: directed at them.
159: 
160: @item BCC
161: Additional mailing address(es) to send the message to, which should
162: not appear in the header of the message actually sent.  @samp{BCC} stands
163: for @dfn{blind carbon copies}.
164: 
165: @item FCC
166: The name of a file, to which a copy of the sent message should be
167: appended.  Emacs writes the message in mbox format, unless the file is
168: in Babyl format (used by Rmail before Emacs 23), in which case Emacs
169: writes in Babyl format.  If an Rmail buffer is visiting the file,
170: Emacs updates it accordingly.  To specify more than one file, use
171: several @samp{FCC} fields, with one file name in each field.
172: 
173: @item Reply-To
174: An address to which replies should be sent, instead of @samp{From}.
175: This is used if, for some reason, your @samp{From} address cannot
176: receive replies.
177: 
178: @item Mail-Reply-To
179: This field takes precedence over @samp{Reply-To}.  It is used because
180: some mailing lists set the @samp{Reply-To} field for their own
181: purposes (a somewhat controversial practice).
182: 
183: @item Mail-Followup-To
184: One of more address(es) to use as default recipient(s) for follow-up
185: messages.  This is typically used when you reply to a message from a
186: mailing list that you are subscribed to, and want replies to go to the
187: list without sending an extra copy to you.
188: 
189: @item In-Reply-To
190: An identifier for the message you are replying to.  Most mail readers
191: use this information to group related messages together.  Normally,
192: this header is filled in automatically when you reply to a message in
193: any mail program built into Emacs.
194: 
195: @item References
196: Identifiers for previous related messages.  Like @samp{In-Reply-To},
197: this is normally filled in automatically for you.
198: @end table
199: 
200: @noindent
201: The @samp{To}, @samp{CC}, and @samp{BCC} fields can appear any number
202: of times, and each such header field can contain multiple addresses,
203: separated by commas.  This way, you can specify any number of places
204: to send the message.  These fields can also have continuation lines:
205: one or more lines starting with whitespace, following the starting
206: line of the field, are considered part of the field.  Here's an
207: example of a @samp{To} field with a continuation line:
208: 
209: @example
210: @group
211: To: foo@@example.net, this@@example.net,
212:   bob@@example.com
213: @end group
214: @end example
215: 
216: @c There is also mail-specify-envelope-from and mail-envelope-from, but
217: @c these are probably not topics for the Emacs manual.
218: 
219: @vindex mail-default-headers
220:   You can direct Emacs to insert certain default headers into the mail
221: buffer by setting the variable @code{mail-default-headers} to a
222: string.  Then @kbd{C-x m} inserts this string into the message
223: headers.  For example, here is how to add a @samp{Reply-To} and
224: @samp{FCC} header to each message:
225: 
226: @smallexample
227: (setq mail-default-headers
228:       "Reply-To: foo@@example.com\nFCC: ~/Mail/sent")
229: @end smallexample
230: 
231: @noindent
232: If the default header fields are not appropriate for a
233: particular message, edit them as necessary before sending the message.
234: 
235: @node Mail Aliases
236: @section Mail Aliases
237: @cindex mail aliases
238: @cindex @file{.mailrc} file
239: @cindex mailrc file
240: @vindex mail-personal-alias-file
241: 
242:   You can define @dfn{mail aliases}, which are short mnemonic names
243: that stand for one or more mailing addresses.  By default, mail
244: aliases are defined in the file @file{~/.mailrc}.  You can specify a
245: different file name to use, by setting the variable
246: @code{mail-personal-alias-file}.
247: 
248:   To define an alias in @file{~/.mailrc}, write a line like this:
249: 
250: @example
251: alias @var{nick} @var{fulladdresses}
252: @end example
253: 
254: @noindent
255: This means that @var{nick} should expand into @var{fulladdresses},
256: where @var{fulladdresses} can be either a single address, or multiple
257: addresses separated with spaces.  For instance, to make @code{maingnu}
258: stand for @code{gnu@@gnu.org} plus a local address of your own, put in
259: this line:
260: 
261: @example
262: alias maingnu gnu@@gnu.org local-gnu
263: @end example
264: 
265: @noindent
266: If an address contains a space, quote the whole address with a pair of
267: double quotes, like this:
268: 
269: @example
270: alias jsmith "John Q. Smith <none@@example.com>"
271: @end example
272: 
273: @noindent
274: Note that you need not include double quotes around individual parts
275: of the address, such as the person's full name.  Emacs puts them in if
276: they are needed.  For instance, it inserts the above address as
277: @samp{"John Q. Smith" <none@@example.com>}.
278: 
279:   Emacs also recognizes include commands in @file{~/.mailrc}.  They
280: look like this:
281: 
282: @example
283: source @var{filename}
284: @end example
285: 
286: @noindent
287: The @file{~/.mailrc} file is not unique to Emacs; many other
288: mail-reading programs use it for mail aliases, and it can contain
289: various other commands.  However, Emacs ignores everything except
290: alias definitions and include commands.
291: 
292: @findex mail-abbrev-insert-alias
293:   Mail aliases expand as abbrevs---that is to say, as soon as you type
294: a word-separator character after an alias (@pxref{Abbrevs}).  This
295: expansion takes place only within the @samp{To}, @samp{From},
296: @samp{CC}, @samp{BCC}, and @samp{Reply-To} header fields (plus their
297: @samp{Resent-} variants); it does not take place in other header
298: fields, such as @samp{Subject}.
299: 
300:   You can also insert an aliased address directly, using the command
301: @kbd{M-x mail-abbrev-insert-alias}.  This reads an alias name, with
302: completion, and inserts its definition at point.
303: 
304: @node Mail Commands
305: @section Mail Commands
306: @cindex Message mode
307: @cindex mode, Message
308: 
309:   The default major mode for the @file{*mail*} buffer is called
310: Message mode.  It behaves like Text mode in many ways, but provides
311: several additional commands on the @kbd{C-c} prefix, which make
312: editing a message more convenient.
313: 
314:   In this section, we will describe some of the most commonly-used
315: commands available in Message mode.
316: @ifnottex
317: Message mode also has its own manual, where its features are described
318: in greater detail.  @xref{Top,,Message, message, Message}.
319: @end ifnottex
320: 
321: @menu
322: * Mail Sending::        Commands to send the message.
323: * Header Editing::      Commands to move to header fields and edit them.
324: * Citing Mail::         Quoting a message you are replying to.
325: * Mail Misc::           Attachments, spell checking, etc.
326: @end menu
327: 
328: @node Mail Sending
329: @subsection Mail Sending
330: 
331: @table @kbd
332: @item C-c C-c
333: Send the message, and bury the mail buffer (@code{message-send-and-exit}).
334: @item C-c C-s
335: Send the message, and leave the mail buffer selected (@code{message-send}).
336: @end table
337: 
338: @kindex C-c C-s @r{(Message mode)}
339: @kindex C-c C-c @r{(Message mode)}
340: @findex message-send
341: @vindex message-kill-buffer-on-exit
342:   The usual command to send a message is @kbd{C-c C-c}
343: (@code{mail-send-and-exit}).  This sends the message and then
344: buries the mail buffer, putting it at the lowest priority for
345: reselection.  If you want it to kill the mail buffer instead, change
346: the variable @code{message-kill-buffer-on-exit} to @code{t}.
347: 
348: @findex message-send-and-exit
349:   The command @kbd{C-c C-s} (@code{message-send}) sends the message
350: and leaves the buffer selected.  Use this command if you want to
351: modify the message (perhaps with new recipients) and send it again.
352: 
353: @vindex message-send-hook
354:   Sending a message runs the hook @code{message-send-hook}.  It also
355: marks the mail buffer as unmodified, except if the mail buffer is also
356: a file-visiting buffer (in that case, only saving the file does that,
357: and you don't get a warning if you try to send the same message
358: twice).
359: 
360: @cindex SMTP
361: @cindex Feedmail
362: @cindex Sendmail
363: @cindex Mailclient
364: @vindex send-mail-function
365:   The variable @code{send-mail-function} controls how the message is
366: delivered.  Its value should be one of the following functions:
367: 
368: @table @code
369: @item sendmail-query-once
370: Query for a delivery method (one of the other entries in this list),
371: and use that method for this message; then save the method to
372: @code{send-mail-function}, so that it is used for future deliveries.
373: This is the default, unless you have already set the variables for
374: sending mail via @code{smtpmail-send-it} (see below).
375: 
376: @item smtpmail-send-it
377: Send mail through an external mail host, such as your
378: Internet service provider's outgoing SMTP mail server.  If you have
379: not told Emacs how to contact the SMTP server, it prompts for this
380: information, which is saved in the @code{smtpmail-smtp-server} variable
381: and the file @file{~/.authinfo}.
382: @xref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}.
383: 
384: @item sendmail-send-it
385: Send mail using the system's default @command{sendmail} program, or
386: equivalent.  This requires the system to be set up for delivering mail
387: directly via SMTP.
388: 
389: @item mailclient-send-it
390: Pass the mail buffer on to the system's designated mail client.  See
391: the commentary section in the file @file{mailclient.el} for details.
392: 
393: @item feedmail-send-it
394: This is similar to @code{sendmail-send-it}, but allows you to queue
395: messages for later sending.  See the commentary section in the file
396: @file{feedmail.el} for details.
397: @end table
398: 
399:   When you send a message containing non-@acronym{ASCII} characters,
400: they need to be encoded with a coding system (@pxref{Coding Systems}).
401: Usually the coding system is specified automatically by your chosen
402: language environment (@pxref{Language Environments}).  You can
403: explicitly specify the coding system for outgoing mail by setting the
404: variable @code{sendmail-coding-system} (@pxref{Recognize Coding}).  If
405: the coding system thus determined does not handle the characters in a
406: particular message, Emacs asks you to select the coding system to use,
407: showing a list of possible coding systems.  @xref{Output Coding}.
408: 
409: @node Header Editing
410: @subsection Mail Header Editing
411: 
412:   Message mode provides the following special commands to move to
413: particular header fields and to complete addresses in headers.
414: 
415: @table @kbd
416: @item C-c C-f C-t
417: Move to the @samp{To} header (@code{message-goto-to}).
418: @item C-c C-f C-s
419: Move to the @samp{Subject} header (@code{message-goto-subject}).
420: @item C-c C-f C-c
421: Move to the @samp{CC} header (@code{message-goto-cc}).
422: @item C-c C-f C-b
423: Move to the @samp{BCC} header (@code{message-goto-bcc}).
424: @item C-c C-f C-r
425: Move to the @samp{Reply-To} header (@code{message-goto-reply-to}).
426: @item C-c C-f C-f
427: Move to the @samp{Mail-Followup-To} header field
428: (@code{message-goto-followup-to}).
429: @item C-c C-f C-w
430: Add a new @samp{FCC} header field, with file-name completion
431: (@code{message-goto-fcc}).
432: @item C-c C-b
433: Move to the start of the message body (@code{message-goto-body}).
434: @item @key{TAB}
435: Complete a mailing address (@code{message-tab}).
436: @end table
437: 
438: @kindex C-c C-f C-t @r{(Message mode)}
439: @findex message-goto-to
440: @kindex C-c C-f C-s @r{(Message mode)}
441: @findex message-goto-subject
442: @kindex C-c C-f C-c @r{(Message mode)}
443: @findex message-goto-cc
444: @kindex C-c C-f C-b @r{(Message mode)}
445: @findex message-goto-bcc
446: @kindex C-c C-f C-r @r{(Message mode)}
447: @findex goto-reply-to
448: @kindex C-c C-f C-f @r{(Message mode)}
449: @findex goto-followup-to
450: @kindex C-c C-f C-w @r{(Message mode)}
451: @findex message-goto-fcc
452:   The commands to move point to particular header fields are all based
453: on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field'').  If the
454: field in question does not exist, the command creates one (the
455: exception is @code{mail-fcc}, which creates a new field each time).
456: 
457: @kindex C-c C-b @r{(Message mode)}
458: @findex mail-text
459:   The command @kbd{C-c C-b} (@code{message-goto-body}) moves point to
460: just after the header separator line---that is, to the beginning of
461: the body.
462: 
463: @findex message-tab
464: @kindex TAB @r{(Message mode)}
465:   While editing a header field that contains addresses, such as
466: @samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete an address by
467: typing @key{TAB} (@code{message-tab}).  This attempts to insert the
468: full name corresponding to the address based on a couple of methods,
469: including EUDC, a library that recognizes a number of directory server
470: protocols (@pxref{Top,,EUDC,eudc, The Emacs Unified Directory
471: Client}).  Failing that, it attempts to expand the address as a mail
472: alias (@pxref{Mail Aliases}).  If point is on a header field that does
473: not take addresses, or if it is in the message body, then @key{TAB}
474: just inserts a tab character.
475: 
476: @node Citing Mail
477: @subsection Citing Mail
478: @cindex citing mail
479: 
480: @table @kbd
481: @item C-c C-y
482: Yank the selected message from the mail reader, as a citation
483: (@code{message-yank-original}).
484: @item C-c C-q
485: Fill each paragraph cited from another message
486: (@code{message-fill-yanked-message}).
487: @end table
488: 
489: @kindex C-c C-y @r{(Message mode)}
490: @findex message-yank-original
491: @findex message-yank-prefix
492:   You can use the command @kbd{C-c C-y} (@code{message-yank-original})
493: to @dfn{cite} a message that you are replying to.  This inserts the
494: text of that message into the mail buffer.  This command works only if
495: the mail buffer is invoked from a mail reader running in Emacs, such
496: as Rmail.
497: 
498:   By default, Emacs inserts the string @samp{>} in front of each line
499: of the cited text; this prefix string is specified by the variable
500: @code{message-yank-prefix}.  If you call @code{message-yank-original}
501: with a prefix argument, the citation prefix is not inserted.
502: 
503: @kindex C-c C-q @r{(Message mode)}
504: @findex mail-fill-yanked-message
505:   After using @kbd{C-c C-y}, you can type @kbd{C-c C-q}
506: (@code{message-fill-yanked-message}) to fill the paragraphs of the
507: cited message.  One use of @kbd{C-c C-q} fills all such paragraphs,
508: each one individually.  To fill a single paragraph of the quoted
509: message, use @kbd{M-q}.  If filling does not automatically handle the
510: type of citation prefix you use, try setting the fill prefix
511: explicitly.  @xref{Filling}.
512: 
513: @vindex mail-citation-hook
514:   You can customize mail citation through the hook
515: @code{mail-citation-hook}.  For example, you can use the Supercite
516: package, which provides more flexible citation
517: (@pxref{Introduction,,,sc, Supercite}).
518: 
519: @node Mail Misc
520: @subsection Mail Miscellany
521: 
522: @kindex C-c C-a @r{(Message mode)}
523: @findex mml-attach-file
524: @cindex MIME
525: @cindex Multipurpose Internet Mail Extensions
526:   You can @dfn{attach} a file to an outgoing message by typing
527: @kbd{C-c C-a} (@code{mml-attach-file}) in the mail buffer.  Attaching
528: is done using the Multipurpose Internet Mail Extensions
529: (@acronym{MIME}) standard.
530: 
531:   The @code{mml-attach-file} command prompts for the name of the file,
532: and for the attachment's @dfn{content type}, @dfn{description}, and
533: @dfn{disposition}.  The content type is normally detected
534: automatically; just type @key{RET} to accept the default.  The
535: description is a single line of text that the recipient will see next
536: to the attachment; you may also choose to leave this empty.  The
537: disposition is either @samp{inline}, which means the recipient will
538: see a link to the attachment within the message body, or
539: @samp{attachment}, which means the link will be separate from the
540: body.
541: 
542: @findex mail-add-attachment
543:   The @code{mml-attach-file} command is specific to Message mode; in
544: Mail mode use @kbd{mail-add-attachment} instead.  It will prompt only
545: for the name of the file, and will determine the content type and the
546: disposition automatically.  If you want to include some description of
547: the attached file, type that in the message body.
548: 
549:   The actual contents of the attached file are not inserted into the
550: mail buffer.  Instead, some placeholder text is inserted into the mail
551: buffer, like this:
552: 
553: @smallexample
554: <#part type="text/plain" filename="~/foo.txt" disposition=inline>
555: <#/part>
556: @end smallexample
557: 
558: @noindent
559: When you type @kbd{C-c C-c} or @kbd{C-c C-s} to send the message, the
560: attached file will be delivered with it.
561: 
562: @findex ispell-message
563:   While composing a message, you can do spelling correction on the
564: message text by typing @kbd{M-x ispell-message}.  If you have yanked
565: an incoming message into the outgoing draft, this command skips what
566: was yanked, but it checks the text that you yourself inserted (it
567: looks for indentation or @code{mail-yank-prefix} to distinguish the
568: cited lines from your input).  @xref{Spelling}.
569: 
570: @vindex message-mode-hook
571: @vindex message-setup-hook
572:   Turning on Message mode (which @kbd{C-x m} does automatically) runs
573: the normal hooks @code{text-mode-hook} and @code{message-mode-hook}.
574: Initializing a new outgoing message runs the normal hook
575: @code{message-setup-hook}; you can use this hook if you want to make
576: changes to the appearance of the mail buffer.  @xref{Hooks}.
577: 
578:   The main difference between these hooks is just when they are
579: invoked.  Whenever you type @kbd{C-x m}, @code{message-mode-hook} runs
580: as soon as the mail buffer is created.  Then the @code{message-setup}
581: function inserts the default contents of the buffer.  After these
582: default contents are inserted, @code{message-setup-hook} runs.
583: 
584:   If you use @kbd{C-x m} to continue an existing composition,
585: @code{message-mode-hook} runs immediately after switching to the mail
586: buffer.  If the buffer is unmodified, or if you decide to erase it and
587: start again, @code{message-setup-hook} runs after the default contents
588: are inserted.
589: 
590: @node Mail Signature
591: @section Mail Signature
592: 
593: @cindex mail signature
594: @vindex message-signature-file
595: @vindex message-signature
596:   You can add a standard piece of text---your @dfn{mail
597: signature}---to the end of every message.  This signature may contain
598: information such as your telephone number or your physical location.
599: The variable @code{message-signature} determines how Emacs handles the
600: mail signature.
601: 
602:   The default value of @code{message-signature} is @code{t}; this
603: means to look for your mail signature in the file @file{~/.signature}.
604: If this file exists, its contents are automatically inserted into the
605: end of the mail buffer.  You can change the signature file via the
606: variable @code{message-signature-file}.
607: 
608:   If you change @code{message-signature} to a string, that specifies
609: the text of the signature directly.
610: 
611: @kindex C-c C-w @r{(Message mode)}
612: @findex message-insert-signature
613:   If you change @code{message-signature} to @code{nil}, Emacs will not
614: insert your mail signature automatically.  You can insert your mail
615: signature by typing @kbd{C-c C-w} (@code{message-insert-signature}) in
616: the mail buffer.  Emacs will look for your signature in the signature
617: file.
618: 
619: @vindex mail-signature-file
620: @vindex mail-signature
621:   If you use Mail mode rather than Message mode for composing your
622: mail, the corresponding variables that determine how your signature is
623: sent are @code{mail-signature} and @code{mail-signature-file} instead.
624: 
625:   By convention, a mail signature should be marked by a line whose
626: contents are @samp{-- }.  If your signature lacks this prefix, it is
627: added for you.  The remainder of your signature should be no more than
628: four lines.
629: 
630: @node Mail Amusements
631: @section Mail Amusements
632: 
633: @findex spook
634: @cindex NSA
635:   @kbd{M-x spook} adds a line of randomly chosen keywords to an outgoing
636: mail message.  The keywords are chosen from a list of words that suggest
637: you are discussing something subversive.
638: 
639:   The idea behind this feature is the suspicion that the
640: NSA@footnote{The US National Security Agency.} and other intelligence
641: agencies snoop on all electronic mail messages that contain keywords
642: suggesting they might find them interesting.  (The agencies say that
643: they don't, but that's what they @emph{would} say.)  The idea is that if
644: lots of people add suspicious words to their messages, the agencies will
645: get so busy with spurious input that they will have to give up reading
646: it all.  Whether or not this is true, it at least amuses some people.
647: 
648: @findex fortune-to-signature
649: @cindex fortune cookies
650:   You can use the @code{fortune} program to put a fortune cookie
651: message into outgoing mail.  To do this, add
652: @code{fortune-to-signature} to @code{mail-setup-hook}:
653: 
654: @example
655: (add-hook 'mail-setup-hook 'fortune-to-signature)
656: @end example
657: 
658: @noindent
659: You will probably need to set the variable @code{fortune-file} before
660: using this.
661: 
662: @node Mail Methods
663: @section Mail-Composition Methods
664: @cindex mail-composition methods
665: @cindex Mail mode
666: @cindex mode, Mail
667: 
668: @cindex MH mail interface
669: @cindex Message mode for sending mail
670:   In this chapter we have described the usual Emacs mode for editing
671: and sending mail---Message mode.  This is only one of several
672: available modes.  Prior to Emacs 23.2, the default mode was Mail mode,
673: which is similar to Message mode in many respects but lacks features
674: such as MIME support.  Another available mode is MH-E
675: (@pxref{Top,,MH-E,mh-e, The Emacs Interface to MH}).
676: 
677: @vindex mail-user-agent
678:   You can choose any of these @dfn{mail user agents} as your preferred
679: method for editing and sending mail.  The commands @kbd{C-x m},
680: @kbd{C-x 4 m} and @kbd{C-x 5 m} use whichever agent you have
681: specified; so do various other parts of Emacs that send mail, such as
682: the bug reporter (@pxref{Bugs}).  To specify a mail user agent,
683: customize the variable @code{mail-user-agent}.  Currently, legitimate
684: values include @code{message-user-agent} (Message mode)
685: @code{sendmail-user-agent} (Mail mode), @code{gnus-user-agent}, and
686: @code{mh-e-user-agent}.
687: 
688:   If you select a different mail-composition method, the information
689: in this chapter about the mail buffer and Message mode does not apply;
690: the other methods use a different format of text in a different
691: buffer, and their commands are different as well.
692: 
693: @vindex read-mail-command
694:   Similarly, to specify your preferred method for reading mail,
695: customize the variable @code{read-mail-command}.  The default is
696: @code{rmail} (@pxref{Rmail}).
697: