Pregunta

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?

¿Fue útil?

Solución

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.

Otros consejos

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");
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top