diff options
authorSergey Poznyakoff <>2019-09-11 12:18:18 +0300
committerSergey Poznyakoff <>2019-09-11 12:18:18 +0300
commite8c4245e1a4c8e2cb130cfcefa4474909bcb7906 (patch)
parent175307d1101993b09d7f0d683404709918683afa (diff)
Document how to set body content-type and encoding in multipart messages
This closes
1 files changed, 20 insertions, 2 deletions
diff --git a/doc/texinfo/programs/mail.texi b/doc/texinfo/programs/mail.texi
index 999dc50cb..b4c68a100 100644
--- a/doc/texinfo/programs/mail.texi
+++ b/doc/texinfo/programs/mail.texi
@@ -1443,7 +1443,7 @@ the old contents of your message.
@subsection Composing Multipart Messages
Multipart messages (or MIME, for short) can be used to send text in
-character set other than ASCII, attach non-text files, send multiple
+character sets other than ASCII, attach non-text files, send multiple
parts in alternative formats, etc.
Technically speaking, the boolean variable @code{mime}
@@ -1516,7 +1516,22 @@ $ mail --content-type=text/html --attach=in.html \
--content-type=application/x-tar --attach=archive.tar
@end example
-Similarly, the encoding to use is set up by the @option{--encoding}
+To change the content type of the message body when sending a message
+with attachments, use the trailing @option{--content-type} option,
+i.e. the option not followed by another @option{--attach} option:
+$ mail --content-type=text/html --attach=in.html \
+ --content-type=application/x-tar --attach=archive.tar \
+ --content-type=text/plain
+@end example
+This example adds two attachments with different content types and
+switched back to the @samp{text/plain} content type for the message
+The encoding to use is set up by the @option{--encoding}
option. As well as @option{--content-type}, this option affects all
attachments supplied after it in the command line as well as the
message body read from the standard input, until changed by
@@ -1530,6 +1545,9 @@ $ mail --content-type=text/html --encoding=quoted-printable \
@end example
+A trailing @option{--encoding} option sets the encoding of the message
Each attachment can also be assigned a @dfn{description} and a
@dfn{file name}. Normally, these are the same as the file name
supplied with the @option{--attach} option. However, you can change

Return to:

Send suggestions and report system problems to the System administrator.