cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to fetch pop3 mail using libcurl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 20 Oct 2011 23:09:20 +0200 (CEST)

On Thu, 20 Oct 2011, mushubi_at_sympatico.ca wrote:

> I am looking for example code on how to fetch pop3 mail using libcurl.

Allow me to give you a very simple one written on demand:

#include <stdio.h>
#include <curl/curl.h>

int main(void)
{
   CURL *curl;
   CURLcode res;

   curl = curl_easy_init();
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "pop3://user:password_at_example.com");
     res = curl_easy_perform(curl);

     /* always cleanup */
     curl_easy_cleanup(curl);
   }
   return 0;
}

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-10-20