Demo program for the [[http://mbed.org/users/hlipka/libraries/pop3|pop3 library]].

Dependencies:   mbed TcpLineStream NetServicesMin pop3 DNSResolver

Files at this revision

API Documentation at this revision

Comitter:
hlipka
Date:
Wed Apr 11 20:35:59 2012 +0000
Commit message:

Changed in this revision

DNSResolver.lib Show annotated file Show diff for this revision Revisions of this file
NetServicesMin.lib Show annotated file Show diff for this revision Revisions of this file
TcpLineStream.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
pop3.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 4a32b2fce260 DNSResolver.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DNSResolver.lib	Wed Apr 11 20:35:59 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/hlipka/code/DNSResolver/#097d4993dd1e
diff -r 000000000000 -r 4a32b2fce260 NetServicesMin.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NetServicesMin.lib	Wed Apr 11 20:35:59 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/hlipka/code/NetServicesMin/#8b387bed54c2
diff -r 000000000000 -r 4a32b2fce260 TcpLineStream.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TcpLineStream.lib	Wed Apr 11 20:35:59 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/hlipka/code/TcpLineStream/#28416a5a4ec5
diff -r 000000000000 -r 4a32b2fce260 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Apr 11 20:35:59 2012 +0000
@@ -0,0 +1,46 @@
+#include "EthernetNetIf.h"
+
+#include "mbed.h"
+
+#include "pop3.h"
+
+main()
+{
+    EthernetNetIf eth;
+    EthernetErr ethErr;
+    printf("Setting up...\n");
+    do {
+        ethErr = eth.setup();
+        if (ethErr) printf("waiting for network...\n", ethErr);
+    } while (ethErr != ETH_OK);
+
+    Pop3 *p3=new Pop3("mail.server","mail.user","mail.password");
+    
+    bool r=p3->init();
+    
+    printf("init ok=%i\n",r);
+    
+    if(r)
+    {
+        list<string> *ids=p3->getMessages();
+        list<string>::iterator it;
+        for ( it=ids->begin() ; it != ids->end(); it++ )
+        {
+            printf("id=%s\n",(*it).c_str());
+            
+            Pop3Message *msg=p3->getMessage(*it);
+            if (NULL==msg)
+                continue;
+            printf("from %s\n",msg->from.c_str());
+            printf("subj %s\n",msg->subject.c_str());
+            
+            p3->deleteMessage(*it);
+            
+            delete msg;
+            
+        }
+        delete ids;
+    }
+    p3->close();
+    delete p3;
+}
\ No newline at end of file
diff -r 000000000000 -r 4a32b2fce260 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Apr 11 20:35:59 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/737756e0b479
diff -r 000000000000 -r 4a32b2fce260 pop3.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pop3.lib	Wed Apr 11 20:35:59 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/hlipka/code/pop3/#3e29a3a6f3bb