summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2019-09-11 09:18:18 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2019-09-11 09:18:18 (GMT)
commite8c4245e1a4c8e2cb130cfcefa4474909bcb7906 (patch) (side-by-side diff)
tree67ded4d51d6b541cf999da0ee4908fdfdc62f067
parent175307d1101993b09d7f0d683404709918683afa (diff)
downloadmailutils-e8c4245e1a4c8e2cb130cfcefa4474909bcb7906.tar.gz
mailutils-e8c4245e1a4c8e2cb130cfcefa4474909bcb7906.tar.bz2
Document how to set body content-type and encoding in multipart messages
This closes https://savannah.gnu.org/support/?109866
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--doc/texinfo/programs/mail.texi22
1 files changed, 20 insertions, 2 deletions
diff --git a/doc/texinfo/programs/mail.texi b/doc/texinfo/programs/mail.texi
index 999dc50..b4c68a1 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:
+
+@example
+$ mail --content-type=text/html --attach=in.html \
+ --content-type=application/x-tar --attach=archive.tar \
+ --content-type=text/plain
+@end example
+
+@nointent
+This example adds two attachments with different content types and
+switched back to the @samp{text/plain} content type for the message
+body.
+
+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 \
--attach=archive.tar
@end example
+A trailing @option{--encoding} option sets the encoding of the message
+body.
+
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.