How to access and extract emails from a SMTP server using APIs

2.1k Views Asked by At

How can I extract extract emails and attachments using an API from a SMTP (Mail) server?

I was trying to figure out how Posterous worked. I found this open source project but it had no source code.

https://code.google.com/p/os-posterous/
2

There are 2 best solutions below

0
Rob M. On BEST ANSWER

The scope of your question is a little too broad, but yes, there are many APIs available for extracting email content and attachments. It is actually pretty simple to do in most programming languages (though javascript has nothing to do with this). You could look at MailGun, AWS Simple Mail just to name a couple or you could roll your own. You don't need to create an SMTP server for this, just access an email address programmatically, scan the contents of new messages and perform some logic on the content/attachments/etc.

0
Sachin Agarwal On

For Posterous I wrote a service in Java which connected to a mail server over IMAP and parsed incoming emails, attachments, etc. The JavaMail framework makes it super simple to do this.