aboutsummaryrefslogtreecommitdiff
path: root/docs/examples/pop3slist.c
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/pop3slist.c')
-rw-r--r--docs/examples/pop3slist.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/examples/pop3slist.c b/docs/examples/pop3slist.c
index 9d9668fa0..cc31bfd07 100644
--- a/docs/examples/pop3slist.c
+++ b/docs/examples/pop3slist.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, 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
@@ -30,7 +30,8 @@ int main(void)
curl = curl_easy_init();
if(curl) {
/* Set username and password */
- curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
/* This will list every message of the given mailbox */
curl_easy_setopt(curl, CURLOPT_URL, "pop3s://user@pop.example.com/");
@@ -61,13 +62,15 @@ int main(void)
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
+
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
- /* always cleanup */
+ /* Always cleanup */
curl_easy_cleanup(curl);
}
+
return 0;
}