aboutsummaryrefslogtreecommitdiff
path: root/docs/examples/smtp-tls.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-12-31 00:19:10 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-12-31 00:19:10 +0000
commit73a894170bce99ed71fcc764422f52a7cc4d3815 (patch)
tree81be26e74deb3a419ae86ae8a131665c64a58560 /docs/examples/smtp-tls.c
parent0aafd77fa4c6f225b656bf76c97015aee6644cac (diff)
examples: Updated SMTP examples to set CURLOPT_UPLOAD
Diffstat (limited to 'docs/examples/smtp-tls.c')
-rw-r--r--docs/examples/smtp-tls.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/examples/smtp-tls.c b/docs/examples/smtp-tls.c
index 3635c103f..7c969764e 100644
--- a/docs/examples/smtp-tls.c
+++ b/docs/examples/smtp-tls.c
@@ -82,7 +82,7 @@ int main(void)
upload_ctx.lines_read = 0;
curl = curl_easy_init();
- if (curl) {
+ if(curl) {
/* This is the URL for your mailserver. Note the use of port 587 here,
* instead of the normal SMTP port (25). Port 587 is commonly used for
* secure mail submission (see RFC4403), but you should use whatever
@@ -118,6 +118,7 @@ int main(void)
/* value for envelope reverse-path */
curl_easy_setopt(curl, CURLOPT_MAIL_FROM, FROM);
+
/* Add two recipients, in this particular case they correspond to the
* To: and Cc: addressees in the header, but they could be any kind of
* recipient. */
@@ -131,6 +132,7 @@ int main(void)
*/
curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source);
curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx);
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* Since the traffic will be encrypted, it is very useful to turn on debug
* information within libcurl to see what is happening during the transfer.