Next: , Previous: Mail Format, Up: Sending Mail


35.2 Mail Header Fields

A header field in the mail buffer starts with a field name at the beginning of a line, terminated by a colon. Upper and lower case are equivalent in field names (and in mailing addresses also). After the colon and optional whitespace comes the contents of the field.

You can use any name you like for a header field, but normally people use only standard field names with accepted meanings. Here is a table of fields commonly used in outgoing messages. Emacs preinitializes some of these when you start to compose a mail, depending on various options you can set. You can delete or alter any header field before you send the message, if you wish.

To
This field contains the mailing addresses to which the message is addressed. If you list more than one address, use commas, not spaces, to separate them.
Subject
The contents of the ‘Subject’ field should be a piece of text that says what the message is about. The reason ‘Subject’ fields are useful is that most mail-reading programs can provide a summary of messages, listing the subject of each message but not its text.
CC
This field contains additional mailing addresses to send the message to, like ‘To’ except that these readers should not regard the message as directed at them.
BCC
This field contains additional mailing addresses to send the message to, which should not appear in the header of the message actually sent. Copies sent this way are called blind carbon copies.

To send a blind carbon copy of every outgoing message to yourself, set the variable mail-self-blind to t. To send a blind carbon copy of every message to some other address, set the variable mail-default-headers to "Bcc: address\n".

FCC
This field contains the name of one file and directs Emacs to append a copy of the message to that file when you send the message. Emacs writes the message in mbox format, unless the file is in Babyl format (used by Rmail before Emacs 23), in which case Emacs writes Babyl. If an Rmail buffer is visiting the file, Emacs updates it accordingly. To specify more than one file, use several ‘FCC’ fields, with one file name in each field.

To put a fixed file name in the ‘FCC’ field each time you start editing an outgoing message, set the variable mail-archive-file-name to that file name. Unless you remove the ‘FCC’ field before sending, the message will be written into that file when it is sent.

From
Use the ‘From’ field to say who you are. You might need to change this if the account you are using to send the mail is not your own. The contents of the ‘From’ field should be a valid mailing address, since replies will normally go there.

Emacs initializes this field (unless the variable mail-setup-with-from is nil) using user-mail-address as the default. If there is no ‘From’ field when you send a mail, Emacs adds one.

Reply-to
Use this field to direct replies to a different address. Most mail-reading programs (including Rmail) automatically send replies to the ‘Reply-to’ address in preference to the ‘From’ address. By adding a ‘Reply-to’ field to your header, you can work around any problems your ‘From’ address may cause for replies.

To put a fixed ‘Reply-to’ address into every outgoing message, set the variable mail-default-reply-to to that address (as a string). Then Emacs initializes the message with a ‘Reply-to’ field as specified. When you first compose a mail, if mail-default-reply-to is nil, Emacs initializes it from the environment variable REPLYTO.

Mail-reply-to
This field takes precedence over ‘Reply-to’. It is used because some mailing lists set the ‘Reply-to’ field for their own purposes (a somewhat controversial practice).
Mail-followup-to
This field contains one or more addresses. It is typically used when you reply to a message from a mailing list that you are subscribed to. It usually indicates that you want replies to go to the list, and that you do not need an extra copy sent directly to you.

The variable mail-mailing-lists holds a list of mailing list addresses that you are subscribed to. If it is non-nil, Emacs inserts an appropriate ‘Mail-followup-to’ header when sending mail to a mailing list.

In-reply-to
This field contains a piece of text describing the message you are replying to. Some mail systems can use this information to correlate related pieces of mail. Normally this field is filled in by Rmail when you reply to a message in Rmail, and you never need to think about it (see Rmail).
References
This field lists the Message-Ids of related previous messages (a Message-Id is a unique identifier generated when a message is sent). Rmail sets up this field automatically when you reply to a message.

The ‘To’, ‘CC’, and ‘BCC’ header fields can appear any number of times, and each such header field can contain multiple addresses, separated by commas. This way, you can specify any number of places to send the message. These fields can also have continuation lines: one or more lines starting with whitespace, following the starting line of the field, are considered part of the field. Here's an example of a ‘To’ field with a continuation line:

     To: foo@here.net, this@there.net,
       me@gnu.cambridge.mass.usa.earth.spiral3281

When you send the message, if you didn't write a ‘From’ field yourself, Emacs puts in one for you, using user-mail-address. The variable mail-from-style controls the format:

nil
Use just the email address, as in ‘king@grassland.com’.
parens
Use both email address and full name, as in:
king@grassland.com (Elvis Parsley)’.
angles
Use both email address and full name, as in:
Elvis Parsley <king@grassland.com>’.
system-default
Allow the system to insert the ‘From’ field.

You can direct Emacs to insert certain default headers into the outgoing message by setting the variable mail-default-headers to a string. Then C-x m inserts this string into the message headers. If the default header fields are not appropriate for a particular message, edit them as necessary before sending the message.