Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jwcnewton/mail-client-adaptor
A mail client written in Java
https://github.com/jwcnewton/mail-client-adaptor
Last synced: 22 days ago
JSON representation
A mail client written in Java
- Host: GitHub
- URL: https://github.com/jwcnewton/mail-client-adaptor
- Owner: jwcnewton
- Created: 2019-07-01T06:59:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-18T09:21:41.000Z (over 3 years ago)
- Last Synced: 2024-11-02T05:50:32.944Z (2 months ago)
- Language: Java
- Size: 578 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mail Client Adaptor
A mail client written in Java[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.jwcnewton/mail-client-adaptor/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.jwcnewton/mail-client-adaptor)
[![Java CI](https://github.com/jwcnewton/mail-client-adaptor/actions/workflows/maven.yml/badge.svg)](https://github.com/jwcnewton/mail-client-adaptor/actions/workflows/maven.yml)
[![Release](https://github.com/jwcnewton/mail-client-adaptor/actions/workflows/release.yml/badge.svg)](https://github.com/jwcnewton/mail-client-adaptor/actions/workflows/release.yml)## Example usage
Print subject using `INewMessageHandler` interface
```java
final String username = "[email protected]";
final String password = "*******";ClientBuilder clientBuilder = new ClientBuilder
.Builder()
.email(username)
.password(password)
.mailbox("Notes")
.clientProperties("gmail")
.protocol("imaps")
.host("smtp.gmail.com")
.build();try(MailClient client = new MailClient(clientBuilder)){
//Set poll interval to 5 seconds
client.pollInterval = 5000;//Simple print message listener
client.addListener(new PrintNewMessageListener());//Run poll
client.start();//Wait an amount of time
Thread.sleep(100000);client.stop();
} catch (Exception e) {
e.printStackTrace();
}```