a Learner
a Learner

Reputation: 5042

Reading mails using Spring email abstraction layer

Spring provides abstraction over JavaMail Api.

There are lot of examples to describe how to send mail using spring email abstraction layer.

but how can i read emails using this?

Upvotes: 6

Views: 10220

Answers (2)

Gordon Mackay
Gordon Mackay

Reputation: 31

You can configure Spring to poll for emails from a POP or IMAP server

http://docs.spring.io/spring-integration/reference/html/mail.html

Or access directly.

MailReceiver receiver = new Pop3MailReceiver("pop3://usr:pwd@localhost/INBOX");

Upvotes: 3

Tomasz Nurkiewicz
Tomasz Nurkiewicz

Reputation: 340983

Maybe because Spring does not have a built-in support for receiving e-mails?

http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mail.html:

24. Email

24.1 Introduction

The Spring Framework provides a helpful utility library for sending email that shields the user from the specifics of the underlying mailing system and is responsible for low level resource handling on behalf of the client.

If you want to receive e-mails you must use some external libraries, including Spring Integration with POP3 support.

Upvotes: 2

Related Questions