Skip to content

Instantly share code, notes, and snippets.

@dinhvh
Created September 27, 2011 09:01
Show Gist options
  • Save dinhvh/1244645 to your computer and use it in GitHub Desktop.
Save dinhvh/1244645 to your computer and use it in GitHub Desktop.
#include <cstdio>
#include <unistd.h>
#include <libetpan/libetpan.h>
int main(void)
{
while(true)
{
struct mailstorage * storage;
int r;
storage = mailstorage_new(NULL);
pop3_mailstorage_init
(
storage,
"pop.t-online.de",
110,
NULL,
CONNECTION_TYPE_PLAIN,
POP3_AUTH_TYPE_TRY_APOP,
"sdfasdf",
"asdfasdf",
0,
NULL,
NULL
);
r = mailstorage_connect(storage);
if (r == MAIL_NO_ERROR) {
fprintf(stderr, "connected\n");
}
else
{
fprintf(stderr, "connection failed: %d\n", r);
}
mailstorage_disconnect(storage);
mailstorage_free(storage);
sleep (5);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment