Mention Hippie Expand.
[bpt/emacs.git] / man / sending.texi
CommitLineData
6bf7aab6
DL
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions.
4@node Sending Mail, Rmail, Picture, Top
5@chapter Sending Mail
6@cindex sending mail
7@cindex mail
8@cindex message
9
10 To send a message in Emacs, you start by typing a command (@kbd{C-x m})
11to select and initialize the @samp{*mail*} buffer. Then you edit the text
12and headers of the message in this buffer, and type another command
13(@kbd{C-c C-s} or @kbd{C-c C-c}) to send the message.
14
15@table @kbd
16@item C-x m
17Begin composing a message to send (@code{compose-mail}).
18@item C-x 4 m
19Likewise, but display the message in another window
20(@code{compose-mail-other-window}).
21@item C-x 5 m
22Likewise, but make a new frame (@code{compose-mail-other-frame}).
23@item C-c C-s
24In Mail mode, send the message (@code{mail-send}).
25@item C-c C-c
26Send the message and bury the mail buffer (@code{mail-send-and-exit}).
27@end table
28
29@kindex C-x m
30@findex compose-mail
31@kindex C-x 4 m
32@findex compose-mail-other-window
33@kindex C-x 5 m
34@findex compose-mail-other-frame
35 The command @kbd{C-x m} (@code{compose-mail}) selects a buffer named
36@samp{*mail*} and initializes it with the skeleton of an outgoing
37message. @kbd{C-x 4 m} (@code{compose-mail-other-window}) selects the
38@samp{*mail*} buffer in a different window, leaving the previous current
39buffer visible. @kbd{C-x 5 m} (@code{compose-mail-other-frame}) creates
40a new frame to select the @samp{*mail*} buffer.
41
42 Because the mail-composition buffer is an ordinary Emacs buffer, you can
43switch to other buffers while in the middle of composing mail, and switch
44back later (or never). If you use the @kbd{C-x m} command again when you
45have been composing another message but have not sent it, you are asked to
46confirm before the old message is erased. If you answer @kbd{n}, the
47@samp{*mail*} buffer is left selected with its old contents, so you can
48finish the old message and send it. @kbd{C-u C-x m} is another way to do
49this. Sending the message marks the @samp{*mail*} buffer ``unmodified,''
50which avoids the need for confirmation when @kbd{C-x m} is next used.
51
52 If you are composing a message in the @samp{*mail*} buffer and want to
53send another message before finishing the first, rename the
54@samp{*mail*} buffer using @kbd{M-x rename-uniquely} (@pxref{Misc
55Buffer}). Then you can use @kbd{C-x m} or its variants described above
56to make a new @samp{*mail*} buffer. Once you've done that, you can work
57with each mail buffer independently.
58
59@menu
60* Format: Mail Format. Format of the mail being composed.
61* Headers: Mail Headers. Details of permitted mail header fields.
62* Aliases: Mail Aliases. Abbreviating and grouping mail addresses.
63* Mode: Mail Mode. Special commands for editing mail being composed.
64* Spook: Distracting NSA. How to distract the NSA's attention.
65* Mail Methods:: Using alternative mail-composition methods.
66@end menu
67
68@node Mail Format
69@section The Format of the Mail Buffer
70
71 In addition to the @dfn{text} or @dfn{body}, a message has @dfn{header
72fields} which say who sent it, when, to whom, why, and so on. Some
73header fields, such as @samp{Date} and @samp{Sender}, are created
74automatically when you send the message. Others, such as the recipient
75names, must be specified by you in order to send the message properly.
76
77 Mail mode provides a few commands to help you edit some header fields,
78and some are preinitialized in the buffer automatically at times. You can
79insert and edit header fields using ordinary editing commands.
80
81 The line in the buffer that says
82
83@example
84--text follows this line--
85@end example
86
87@noindent
88is a special delimiter that separates the headers you have specified from
89the text. Whatever follows this line is the text of the message; the
90headers precede it. The delimiter line itself does not appear in the
91message actually sent. The text used for the delimiter line is controlled
92by the variable @code{mail-header-separator}.
93
94Here is an example of what the headers and text in the mail buffer
95might look like.
96
97@example
98To: gnu@@gnu.org
99CC: lungfish@@spam.org, byob@@spam.org
100Subject: The Emacs Manual
101--Text follows this line--
102Please ignore this message.
103@end example
104
105@node Mail Headers
106@section Mail Header Fields
107@cindex headers (of mail message)
108
109 A header field in the mail buffer starts with a field name at the
110beginning of a line, terminated by a colon. Upper and lower case are
111equivalent in field names (and in mailing addresses also). After the
112colon and optional whitespace comes the contents of the field.
113
114 You can use any name you like for a header field, but normally people
115use only standard field names with accepted meanings. Here is a table
116of fields commonly used in outgoing messages.
117
118@table @samp
119@item To
120This field contains the mailing addresses to which the message is
121addressed. If you list more than one address, use commas, not spaces,
122to separate them.
123
124@item Subject
125The contents of the @samp{Subject} field should be a piece of text
126that says what the message is about. The reason @samp{Subject} fields
127are useful is that most mail-reading programs can provide a summary of
128messages, listing the subject of each message but not its text.
129
130@item CC
131This field contains additional mailing addresses to send the message to,
132like @samp{To} except that these readers should not regard the message
133as directed at them.
134
135@item BCC
136This field contains additional mailing addresses to send the message to,
137which should not appear in the header of the message actually sent.
138Copies sent this way are called @dfn{blind carbon copies}.
139
140@vindex mail-self-blind
141To send a blind carbon copy of every outgoing message to yourself, set
142the variable @code{mail-self-blind} to @code{t}.
143
144@item FCC
145This field contains the name of one file and directs Emacs to append a
146copy of the message to that file when you send the message. If the file
147is in Rmail format, Emacs writes the message in Rmail format; otherwise,
148Emacs writes the message in system mail file format.
149
150@vindex mail-archive-file-name
151To put a fixed file name in the @samp{FCC} field each time you start
152editing an outgoing message, set the variable
153@code{mail-archive-file-name} to that file name. Unless you remove the
154@samp{FCC} field before sending, the message will be written into that
155file when it is sent.
156
157@item From
158Use the @samp{From} field to say who you are, when the account you are
159using to send the mail is not your own. The contents of the @samp{From}
160field should be a valid mailing address, since replies will normally go
161there. If you don't specify the @samp{From} field yourself, Emacs uses
162the value of @code{user-mail-address} as the default.
163
164@item Reply-to
165Use this field to direct replies to a different address. Most
166mail-reading programs (including Rmail) automatically send replies to
167the @samp{Reply-to} address in preference to the @samp{From} address.
168By adding a @samp{Reply-to} field to your header, you can work around
169any problems your @samp{From} address may cause for replies.
170
171@cindex @code{REPLYTO} environment variable
172@vindex mail-default-reply-to
173To put a fixed @samp{Reply-to} address into every outgoing message, set
174the variable @code{mail-default-reply-to} to that address (as a string).
175Then @code{mail} initializes the message with a @samp{Reply-to} field as
176specified. You can delete or alter that header field before you send
177the message, if you wish. When Emacs starts up, if the environment
178variable @code{REPLYTO} is set, @code{mail-default-reply-to} is
179initialized from that environment variable.
180
181@item In-reply-to
182This field contains a piece of text describing a message you are
183replying to. Some mail systems can use this information to correlate
184related pieces of mail. Normally this field is filled in by Rmail
185when you reply to a message in Rmail, and you never need to
186think about it (@pxref{Rmail}).
187
188@item References
189This field lists the message IDs of related previous messages. Rmail
190sets up this field automatically when you reply to a message.
191@end table
192
193 The @samp{To}, @samp{CC}, @samp{BCC} and @samp{FCC} header fields can
194appear any number of times, and each such header field can contain
195multiple addresses, separated by commas. This way, you can specify any
196number of places to send the message. A @samp{To}, @samp{CC}, or
197@samp{BCC} field can also have continuation lines: one or more lines
198starting with whitespace, following the starting line of the field, are
199considered part of the field. Here's an example of a @samp{To} field
200with a continuation line:@refill
201
202@example
203@group
204To: foo@@here.net, this@@there.net,
205 me@@gnu.cambridge.mass.usa.earth.spiral3281
206@end group
207@end example
208
209@vindex mail-from-style
210 When you send the message, if you didn't write a @samp{From} field
211yourself, Emacs puts in one for you. The variable
212@code{mail-from-style} controls the format:
213
214@table @code
215@item nil
216Use just the email address, as in @samp{king@@grassland.com}.
217@item parens
218Use both email address and full name, as in @samp{king@@grassland.com (Elvis
219Parsley)}.
220@item angles
221Use both email address and full name, as in @samp{Elvis Parsley
222<king@@grassland.com>}.
223@item system-default
224Allow the system to insert the @samp{From} field.
225@end table
226
227@node Mail Aliases
228@section Mail Aliases
229@cindex mail aliases
230@cindex @file{.mailrc} file
231@cindex mailrc file
232
233 You can define @dfn{mail aliases} in a file named @file{~/.mailrc}.
234These are short mnemonic names which stand for mail addresses or groups of
235mail addresses. Like many other mail programs, Emacs expands aliases
236when they occur in the @samp{To}, @samp{From}, @samp{CC}, @samp{BCC}, and
237@samp{Reply-to} fields, plus their @samp{Resent-} variants.
238
239 To define an alias in @file{~/.mailrc}, write a line in the following
240format:
241
242@example
243alias @var{shortaddress} @var{fulladdresses}
244@end example
245
246@noindent
247Here @var{fulladdresses} stands for one or more mail addresses for
248@var{shortaddress} to expand into. Separate multiple addresses with
249spaces; if an address contains a space, quote the whole address with a
250pair of double-quotes.
251
252For instance, to make @code{maingnu} stand for
253@code{gnu@@gnu.org} plus a local address of your own, put in
254this line:@refill
255
256@example
257alias maingnu gnu@@gnu.org local-gnu
258@end example
259
260 Emacs also recognizes include commands in @samp{.mailrc} files.
261They look like this:
262
263@example
264source @var{filename}
265@end example
266
267@noindent
268The file @file{~/.mailrc} is used primarily by other mail-reading
269programs; it can contain various other commands. Emacs ignores
270everything in it except for alias definitions and include commands.
271
272@findex define-mail-alias
273 Another way to define a mail alias, within Emacs alone, is with the
274@code{define-mail-alias} command. It prompts for the alias and then the
275full address. You can use it to define aliases in your @file{.emacs}
276file, like this:
277
278@example
279(define-mail-alias "maingnu" "gnu@@gnu.org")
280@end example
281
282@vindex mail-aliases
283 @code{define-mail-alias} records aliases by adding them to a
284variable named @code{mail-aliases}. If you are comfortable with
285manipulating Lisp lists, you can set @code{mail-aliases} directly. The
286initial value of @code{mail-aliases} is @code{t}, which means that
287Emacs should read @file{.mailrc} to get the proper value.
288
289@vindex mail-personal-alias-file
290 You can specify a different file name to use instead of
291@file{~/.mailrc} by setting the variable
292@code{mail-personal-alias-file}.
293
294@findex expand-mail-aliases
295 Normally, Emacs expands aliases when you send the message. You do not
296need to expand mail aliases before sending the message, but you can
297expand them if you want to see where the mail will actually go. To do
298this, use the command @kbd{M-x expand-mail-aliases}; it expands all mail
299aliases currently present in the mail headers that hold addresses.
300
301 If you like, you can have mail aliases expand as abbrevs, as soon as
302you type them in (@pxref{Abbrevs}). To enable this feature, execute the
303following:
304
305@example
306(add-hook 'mail-setup-hook 'mail-abbrevs-setup)
307@end example
308
309@noindent
310@findex define-mail-abbrev
311@vindex mail-abbrevs
312This can go in your @file{.emacs} file. @xref{Hooks}. If you use this
313feature, you must use @code{define-mail-abbrev} instead of
314@code{define-mail-alias}; the latter does not work with this package.
315Note that the mail abbreviation package uses the variable
316@code{mail-abbrevs} instead of @code{mail-aliases}, and that all alias
317names are converted to lower case.
318
319@kindex C-c C-a @r{(Mail mode)}
320@findex mail-interactive-insert-alias
321 The mail abbreviation package also provides the @kbd{C-c C-a}
322(@code{mail-interactive-insert-alias}) command, which reads an alias
323name (with completion) and inserts its definition at point. This is
324useful when editing the message text itself or a header field such as
325@samp{Subject} in which Emacs does not normally expand aliases.
326
327 Note that abbrevs expand only if you insert a word-separator character
328afterward. However, you can rebind @kbd{C-n} and @kbd{M->} to cause
329expansion as well. Here's how to do that:
330
331@smallexample
332(add-hook 'mail-setup-hook
333 '(lambda ()
334 (substitute-key-definition
335 'next-line 'mail-abbrev-next-line
336 mail-mode-map global-map)
337 (substitute-key-definition
338 'end-of-buffer 'mail-abbrev-end-of-buffer
339 mail-mode-map global-map)))
340@end smallexample
341
342@node Mail Mode
343@section Mail Mode
344@cindex Mail mode
345@cindex mode, Mail
346
347 The major mode used in the mail buffer is Mail mode, which is much
348like Text mode except that various special commands are provided on the
349@kbd{C-c} prefix. These commands all have to do specifically with
350editing or sending the message. In addition, Mail mode defines the
351character @samp{%} as a word separator; this is helpful for using the
352word commands to edit mail addresses.
353
354 Mail mode is normally used in buffers set up automatically by the
355@code{mail} command and related commands. However, you can also switch
356to Mail mode in a file-visiting buffer. That is a useful thing to do if
357you have saved draft message text in a file.
358
359@menu
360* Mail Sending:: Commands to send the message.
361* Header Editing:: Commands to move to header fields and edit them.
362* Citing Mail:: Copying all or part of a message you are replying to.
363* Mail Mode Misc:: Spell checking, signatures, etc.
364@end menu
365
366@node Mail Sending
367@subsection Mail Sending
368
369 Mail mode has two commands for sending the message you have been
370editing:
371
372@table @kbd
373@item C-c C-s
374Send the message, and leave the mail buffer selected (@code{mail-send}).
375@item C-c C-c
376Send the message, and select some other buffer (@code{mail-send-and-exit}).
377@end table
378
379@kindex C-c C-s @r{(Mail mode)}
380@kindex C-c C-c @r{(Mail mode)}
381@findex mail-send
382@findex mail-send-and-exit
383 @kbd{C-c C-s} (@code{mail-send}) sends the message and marks the mail
384buffer unmodified, but leaves that buffer selected so that you can
385modify the message (perhaps with new recipients) and send it again.
386@kbd{C-c C-c} (@code{mail-send-and-exit}) sends and then deletes the
387window or switches to another buffer. It puts the mail buffer at the
388lowest priority for reselection by default, since you are finished with
389using it. This is the usual way to send the message.
390
391 In a file-visiting buffer, sending the message does not clear the
392modified flag, because only saving the file should do that. As a
393result, you don't get a warning if you try to send the same message
394twice.
395
396@vindex sendmail-coding-system
397 When you send a message that contains non-ASCII characters, they need
398to be encoded with a coding system (@pxref{Coding Systems}). Usually
399the coding system is specified automatically by your chosen language
400environment (@pxref{Language Environments}). You can explicitly specify
401the coding system for outgoing mail by setting the variable
402@code{sendmail-coding-system}.
403
404 If the coding system thus determined does not handle the characters in
405a particular message, Emacs asks you to select the coding system to use,
406showing a list of possible coding systems.
407
408@node Header Editing
409@subsection Mail Header Editing
410
411 Mail mode provides special commands to move to particular header
412fields and to complete addresses in headers.
413
414@table @kbd
415@item C-c C-f C-t
416Move to the @samp{To} header field, creating one if there is none
417(@code{mail-to}).
418@item C-c C-f C-s
419Move to the @samp{Subject} header field, creating one if there is
420none (@code{mail-subject}).
421@item C-c C-f C-c
422Move to the @samp{CC} header field, creating one if there is none
423(@code{mail-cc}).
424@item C-c C-f C-b
425Move to the @samp{BCC} header field, creating one if there is none
426(@code{mail-bcc}).
427@item C-c C-f C-f
428Move to the @samp{FCC} header field, creating one if there is none
429(@code{mail-fcc}).
430@item M-@key{TAB}
431Complete a mailing address (@code{mail-complete}).
432@end table
433
434@kindex C-c C-f C-t @r{(Mail mode)}
435@findex mail-to
436@kindex C-c C-f C-s @r{(Mail mode)}
437@findex mail-subject
438@kindex C-c C-f C-c @r{(Mail mode)}
439@findex mail-cc
440@kindex C-c C-f C-b @r{(Mail mode)}
441@findex mail-bcc
442@kindex C-c C-f C-f @r{(Mail mode)}
443@findex mail-fcc
444 There are five commands to move point to particular header fields, all
445based on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field''). They
446are listed in the table above. If the field in question does not exist,
447these commands create one. We provide special motion commands for these
448particular fields because they are the fields users most often want to
449edit.
450
451@findex mail-complete
452@kindex M-TAB @r{(Mail mode)}
453 While editing a header field that contains mailing addresses, such as
454@samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete a mailing
455address by typing @kbd{M-@key{TAB}} (@code{mail-complete}). It inserts
456the full name corresponding to the address, if it can determine the full
457name. The variable @code{mail-complete-style} controls whether to insert
458the full name, and what style to use, as in @code{mail-from-style}
459(@pxref{Mail Headers}).
460
461 For completion purposes, the valid mailing addresses are taken to be
462the local users' names plus your personal mail aliases. You can specify
463additional sources of valid addresses; use the customization buffer
464to see the options for this.
465
466 If you type @kbd{M-@key{TAB}} in the body of the message, it invokes
467@code{ispell-complete-word}, as in Text mode.
468
469@node Citing Mail
470@subsection Citing Mail
471@cindex citing mail
472
473 Mail mode also has commands for yanking or @dfn{citing} all or part of
474a message that you are replying to. These commands are active only when
475you started sending a message using an Rmail command.
476
477@table @kbd
478@item C-c C-y
479Yank the selected message from Rmail (@code{mail-yank-original}).
480@item C-c C-r
481Yank the region from the Rmail buffer (@code{mail-yank-region}).
482@item C-c C-q
483Fill each paragraph cited from another message
484(@code{mail-fill-yanked-message}).
485@end table
486
487@kindex C-c C-y @r{(Mail mode)}
488@findex mail-yank-original
489 When mail sending is invoked from the Rmail mail reader using an Rmail
490command, @kbd{C-c C-y} can be used inside the mail buffer to insert
491the text of the message you are replying to. Normally it indents each line
492of that message three spaces and eliminates most header fields. A numeric
493argument specifies the number of spaces to indent. An argument of just
494@kbd{C-u} says not to indent at all and not to eliminate anything.
495@kbd{C-c C-y} always uses the current message from the Rmail buffer,
496so you can insert several old messages by selecting one in Rmail,
497switching to @samp{*mail*} and yanking it, then switching back to
498Rmail to select another.
499
500@vindex mail-yank-prefix
501 You can specify the text for @kbd{C-c C-y} to insert at the beginning
502of each line: set @code{mail-yank-prefix} to the desired string. (A
503value of @code{nil} means to use indentation; this is the default.)
504However, @kbd{C-u C-c C-y} never adds anything at the beginning of the
505inserted lines, regardless of the value of @code{mail-yank-prefix}.
506
507@kindex C-c C-r @r{(Mail mode)}
508@findex mail-yank-region
509 To yank just a part of an incoming message, set the region in Rmail to
510the part you want; then go to the @samp{*Mail*} message and type
511@kbd{C-c C-r} (@code{mail-yank-region}). Each line that is copied is
512indented or prefixed according to @code{mail-yank-prefix}.
513
514@kindex C-c C-q @r{(Mail mode)}
515@findex mail-fill-yanked-message
516 After using @kbd{C-c C-y} or @kbd{C-c C-r}, you can type @kbd{C-c C-q}
517(@code{mail-fill-yanked-message}) to fill the paragraphs of the yanked
518old message or messages. One use of @kbd{C-c C-q} fills all such
519paragraphs, each one individually. To fill a single paragraph of the
520quoted message, use @kbd{M-q}. If filling does not automatically
521handle the type of citation prefix you use, try setting the fill prefix
522explicitly. @xref{Filling}.
523
524@node Mail Mode Misc
525@subsection Mail Mode Miscellany
526
527@table @kbd
528@item C-c C-t
529Move to the beginning of the message body text (@code{mail-text}).
530@item C-c C-w
531Insert the file @file{~/.signature} at the end of the message text
532(@code{mail-signature}).
533@item C-c C-i @var{file} @key{RET}
534Insert the contents of @var{file} at the end of the outgoing message
535(@code{mail-attach-file}).
536@item M-x ispell-message
537Do spelling correction on the message text, but not on citations from
538other messages.
539@end table
540
541@kindex C-c C-t @r{(Mail mode)}
542@findex mail-text
543 @kbd{C-c C-t} (@code{mail-text}) moves point to just after the header
544separator line---that is, to the beginning of the message body text.
545
546@kindex C-c C-w @r{(Mail mode)}
547@findex mail-signature
548@vindex mail-signature
549 @kbd{C-c C-w} (@code{mail-signature}) adds a standard piece of text at
550the end of the message to say more about who you are. The text comes
551from the file @file{~/.signature} in your home directory. To insert
552your signature automatically, set the variable @code{mail-signature} to
553@code{t}; then starting a mail message automatically inserts the
554contents of your @file{~/.signature} file. If you want to omit your
555signature from a particular message, delete it from the buffer before
556you send the message.
557
558 You can also set @code{mail-signature} to a string; then that string
559is inserted automatically as your signature when you start editing a
560message to send. If you set it to some other Lisp expression, the
561expression is evaluated each time, and its value (which should be a
562string) specifies the signature.
563
564@findex ispell-message
565 You can do spelling correction on the message text you have written
566with the command @kbd{M-x ispell-message}. If you have yanked an
567incoming message into the outgoing draft, this command skips what was
568yanked, but it checks the text that you yourself inserted. (It looks
569for indentation or @code{mail-yank-prefix} to distinguish the cited
570lines from your input.) @xref{Spelling}.
571
572@kindex C-c C-i @r{(Mail mode)}
573@findex mail-attach-file
574 To include a file in the outgoing message, you can use @kbd{C-x i},
575the usual command to insert a file in the current buffer. But it is
576often more convenient to use a special command, @kbd{C-c C-i}
577(@code{mail-attach-file}). This command inserts the file contents at
578the end of the buffer, after your signature if any, with a delimiter
579line that includes the file name.
580
581@vindex mail-mode-hook
582@vindex mail-setup-hook
583 Turning on Mail mode (which @kbd{C-x m} does automatically) runs the
584normal hooks @code{text-mode-hook} and @code{mail-mode-hook}.
585Initializing a new outgoing message runs the normal hook
586@code{mail-setup-hook}; if you want to add special fields to your mail
587header or make other changes to the appearance of the mail buffer, use
588that hook. @xref{Hooks}.
589
590 The main difference between these hooks is just when they are
591invoked. Whenever you type @kbd{M-x mail}, @code{mail-mode-hook} runs
592as soon as the @samp{*mail*} buffer is created. Then the
593@code{mail-setup} function puts in the default contents of the buffer.
594After these default contents are inserted, @code{mail-setup-hook} runs.
595
596@node Distracting NSA
597@section Distracting the NSA
598
599@findex spook
600@cindex NSA
601 @kbd{M-x spook} adds a line of randomly chosen keywords to an outgoing
602mail message. The keywords are chosen from a list of words that suggest
603you are discussing something subversive.
604
605 The idea behind this feature is the suspicion that the NSA snoops on
606all electronic mail messages that contain keywords suggesting they might
607find them interesting. (The NSA says they don't, but that's what they
608@emph{would} say.) The idea is that if lots of people add suspicious
609words to their messages, the NSA will get so busy with spurious input
610that they will have to give up reading it all.
611
612 Here's how to insert spook keywords automatically whenever you start
613entering an outgoing message:
614
615@example
616(add-hook 'mail-setup-hook 'spook)
617@end example
618
619 Whether or not this confuses the NSA, it at least amuses people.
620
621@node Mail Methods
622@section Mail-Composition Methods
623@cindex mail-composition methods
624
625 This chapter describes the usual Emacs mode for editing and sending
626mail---Mail mode. Emacs has alternative facilities for editing and
627sending mail, including MH-E and Message mode, not documented in this
628manual. You can choose any of them as your preferred method. The
629commands @code{C-x m}, @code{C-x 4 m} and @code{C-x 5 m} use whichever
630agent you have specified. So do various other Emacs commands and
631facilities that send mail.
632
633@vindex mail-user-agent
634 To specify your mail-composition method, set the variable
635@code{mail-user-agent}. Currently legitimate values include
636@code{sendmail-user-agent}, @code{mh-e-user-agent}, and
637@code{message-user-agent}.
638
639 If you select a different mail-composition method, the information in
640this chapter about the @samp{*mail*} buffer and Mail mode does not
641apply; other methods may use completely different commands with a
642different format in a differently named buffer.
643