Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
ab71241c
Commit
ab71241c
authored
11 years ago
by
Steve Holme
Browse files
Options
Downloads
Patches
Plain Diff
examples: Updated IMAP fetch example for libcurl 7.30.0
parent
e9625c5b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/examples/imap-fetch.c
+17
-4
17 additions, 4 deletions
docs/examples/imap-fetch.c
with
17 additions
and
4 deletions
docs/examples/imap-fetch.c
+
17
−
4
View file @
ab71241c
...
...
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 201
2
, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 201
3
, 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
...
...
@@ -22,6 +22,12 @@
#include
<stdio.h>
#include
<curl/curl.h>
/* This is a simple example showing how to fetch mail using libcurl's IMAP
* capabilities.
*
* Note that this example requires libcurl 7.30.0 or above.
*/
int
main
(
void
)
{
CURL
*
curl
;
...
...
@@ -32,13 +38,20 @@ int main(void)
/* Set username and password */
curl_easy_setopt
(
curl
,
CURLOPT_USERPWD
,
"user:password"
);
/* This will fetch
the mailbox named "foobar"
*/
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
"imap://imap.example.com/
foobar
"
);
/* This will fetch
message 1 from the user's inbox
*/
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
"imap://imap.example.com/
INBOX/;UID=1
"
);
/* Perform the fetch */
res
=
curl_easy_perform
(
curl
);
/* always cleanup */
/* Check for errors */
if
(
res
!=
CURLE_OK
)
fprintf
(
stderr
,
"curl_easy_perform() failed: %s
\n
"
,
curl_easy_strerror
(
res
));
/* Always cleanup */
curl_easy_cleanup
(
curl
);
}
return
(
int
)
res
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment