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?
The Spring Framework is an open-source framework for building enterprise Java applications. Spring aims to simplify the complex and cumbersome enterprise Java application development process by offering a framework that includes technologies such as: Aspect-oriented programming (AOP) Dependency injection (DI)
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");
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With