diff options
Diffstat (limited to 'docs/libcurl/curl_mime_subparts.3')
-rw-r--r-- | docs/libcurl/curl_mime_subparts.3 | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/docs/libcurl/curl_mime_subparts.3 b/docs/libcurl/curl_mime_subparts.3 index 9240e81aa..2e5a29574 100644 --- a/docs/libcurl/curl_mime_subparts.3 +++ b/docs/libcurl/curl_mime_subparts.3 @@ -5,11 +5,11 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. +.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * .\" * This software is licensed as described in the file COPYING, which .\" * you should have received as part of this distribution. The terms -.\" * are also available at https://curl.haxx.se/docs/copyright.html. +.\" * are also available at https://curl.se/docs/copyright.html. .\" * .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell .\" * copies of the Software, and permit persons to whom the Software is @@ -19,7 +19,7 @@ .\" * KIND, either express or implied. .\" * .\" ************************************************************************** -.TH curl_mime_subparts 3 "September 05, 2017" "libcurl 7.73.0" "libcurl Manual" +.TH curl_mime_subparts 3 "October 25, 2021" "libcurl 7.80.0" "libcurl Manual" .SH NAME curl_mime_subparts - set subparts of a multipart mime part @@ -43,12 +43,32 @@ subsequent calls to mime API functions. Setting a part's contents twice is valid: only the value set by the last call is retained. It is possible to unassign previous part's contents by setting \fIsubparts\fP to NULL. +.SH EXAMPLE +.nf + /* The inline part is an alternative proposing the html and the text + versions of the e-mail. */ + alt = curl_mime_init(curl); + + /* HTML message. */ + part = curl_mime_addpart(alt); + curl_mime_data(part, inline_html, CURL_ZERO_TERMINATED); + curl_mime_type(part, "text/html"); + + /* Text message. */ + part = curl_mime_addpart(alt); + curl_mime_data(part, inline_text, CURL_ZERO_TERMINATED); + + /* Create the inline part. */ + part = curl_mime_addpart(mime); + curl_mime_subparts(part, alt); + curl_mime_type(part, "multipart/alternative"); + slist = curl_slist_append(NULL, "Content-Disposition: inline"); + curl_mime_headers(part, slist, 1); +.fi .SH AVAILABILITY As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. .SH RETURN VALUE CURLE_OK or a CURL error code upon failure. -.SH EXAMPLE -TODO .SH "SEE ALSO" .BR curl_mime_addpart "(3)," .BR curl_mime_init "(3)" |