venkat - 2011-07-15

vmime::ref <vmime::net::session> dockMailSession = vmime::create <vmime::net::session>();
vmime::utility::url storeURL("imap://");
vmime::ref <vmime::net::store> store = dockMailSession->getStore(storeURL);

// Open the INBOX
   vmime::ref <vmime::net::folder> folder = store->getDefaultFolder();

   // Get the first message in the INBOX
   vmime::ref <vmime::net::message> msg = folder->getMessage(1);

   // Construct the parsed message (a few data, header and structure,
   // is actually downloaded from the IMAP server)
   //vmime::ref <vmime::net:: body> msgBody = msg->
   // Here, extract() will actually download message data from the server
   vmime::utility::outputStreamAdapter out(std::cout);
   catch(vmime:: exception& e)
       std::cout << e.what();

is giving an exception

error while connecting socket