(emacs)Mail Aliases

Next: Mail Mode Prev: Mail Headers Up: Sending Mail

Mail Aliases

   You can define "mail aliases" in a file named `~/.mailrc'.  These
are short mnemonic names stand for mail addresses or groups of mail
addresses.  Like many other mail programs, Emacs expands aliases when
they occur in the `To', `CC', and `BCC' fields.

   To define an alias in `~/.mailrc', write a line in the following


For instance, if you send want to use `maingnu' as a short form of the
address `gnu@prep.ai.mit.edu', put in the line:

     alias maingnu gnu@prep.ai.mit.edu

The file `~/.mailrc' is used primarily by other mail-reading programs;
it can contain various other commands.  Emacs ignores everything in it
except for alias definitions.

   Another way to define a mail alias, within Emacs alone, is with the
`define-mail-alias' command.  It prompts for the alias and then the
full address.  You can use it to define aliases in your `.emacs' file,
like this:

     (define-mail-alias "maingnu" "gnu@prep.ai.mit.edu")

   `define-mail-alias' records aliases by adding them to a variable
named `mail-aliases'.  If your are comfortable with manipulating Lisp
lists, you can set `mail-aliases' directly.  The initial value of
`mail-aliases' is `t', which means that Emacs should read `.mailrc' to
get the proper value.

   Normally, Emacs expands aliases when you send the message.  If you
like, you can have mail aliases expand as abbrevs, as soon as you type
them in.  To enable this feature, execute the following:

     (add-hook 'mail-setup-hook 'mail-abbrevs-setup)

This can go in your `.emacs' file.  Note: Hooks.  If you use this
feature, you must use `define-mail-abbrev' instead of
`define-mail-alias'; the latter does not work with this package.  Also,
the mail abbreviation package uses the variable `mail-abbrevs' instead
of `mail-aliases'.

   Note that abbrevs expand only if you insert a word-separator
character afterward.  However, any mail aliases that you didn't expand
in the mail buffer are expanded subsequently when you send the message.
Note: Abbrevs.

automatically generated by info2www