aboutsummaryrefslogtreecommitdiff
path: root/docs/examples/smtp-tls.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-01-12 15:30:45 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-01-12 15:43:07 +0000
commit7e8596408042611d70aa073ed4b577446ffc7a03 (patch)
tree14ef89df69241edff220a68a8159fba2203f96d1 /docs/examples/smtp-tls.c
parent9bd2fdb8e24ffaace66bce12cfa5a5715e565783 (diff)
examples: Synchronised comments between SMTP MAIL examples
Diffstat (limited to 'docs/examples/smtp-tls.c')
-rw-r--r--docs/examples/smtp-tls.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/docs/examples/smtp-tls.c b/docs/examples/smtp-tls.c
index 4e610d9ac..4872dbdf1 100644
--- a/docs/examples/smtp-tls.c
+++ b/docs/examples/smtp-tls.c
@@ -117,7 +117,12 @@ int main(void)
* docs/SSLCERTS for more information. */
curl_easy_setopt(curl, CURLOPT_CAINFO, "/path/to/certificate.pem");
- /* Value for envelope reverse-path */
+ /* Note that this option isn't strictly required, omitting it will result in
+ * libcurl sending the MAIL FROM command with empty sender data. All
+ * autoresponses should have an empty reverse-path, and should be directed
+ * to the address in the reverse-path which triggered them. Otherwise, they
+ * could cause an endless loop. See RFC 5321 Section 4.5.5 for more details.
+ */
curl_easy_setopt(curl, CURLOPT_MAIL_FROM, FROM);
/* Add two recipients, in this particular case they correspond to the
@@ -127,9 +132,9 @@ int main(void)
recipients = curl_slist_append(recipients, CC);
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
- /* In this case, we're using a callback function to specify the data. You
- * could just use the CURLOPT_READDATA option to specify a FILE pointer to
- * read from. */
+ /* We're using a callback function to specify the payload (the headers and
+ * body of the message). You could just use the CURLOPT_READDATA option to
+ * specify a FILE pointer to read from. */
curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source);
curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx);
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);