Search code examples
objective-ccordovacordova-plugins

How to fetch POP3/SMTP email using Cordova


I'm new to mobile development and have been looking for a way to retrieve basic email information from simple POP3/SMTP email servers.

I've seen many posts on how to send email using numerous Cordova plugins, etc., but I'm simply trying to retrieve email information for various listing and analysis purposes.

Is this even possible?

Thanks for the help and suggestions on where to start.


Solution

  • Cordova does not have built-in functionality for POP3/SMTP access. As inside your codova app you are running in the javascript/webview sandbox, you don't have socket access, so you can't implement this kind of functionality there.

    This leaves you no choice but to implement a Cordova Plugin. You are in Objective-C land now, but unfortunately there aren't any convenient classes in the standard framework for accessing POP3/SMTP. Your best bet is using a library like MailCore.

    Details on how to implement a Cordova Plugin (as well as passing the relevant email data from and to your javascript layer) are outside the scope of a simple StackOverflow answer, but the process is (fortunately) well documented.