Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upstream #10

Merged
merged 47 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
60a451e
Merge pull request #1 from shivam1608/development
shivam1608 Apr 22, 2022
a72534e
Update README.md
shivam1608 Apr 22, 2022
ef61684
Update README.md
shivam1608 Apr 22, 2022
ef6ec80
Update README.md
shivam1608 Apr 22, 2022
51eddb4
Update README.md
shivam1608 Apr 22, 2022
f3477ed
ignore eclipse project file
awidesky Sep 26, 2022
5ecd64b
bugfix in example(generating random domain)
awidesky Sep 26, 2022
bd8116b
add .gitignore for eclipse
awidesky Sep 29, 2022
ac67f6f
FunctionalInterface annotation because a lambda can be WorkCallback
awidesky Oct 1, 2022
bd30199
add Synchronous methods
awidesky Oct 1, 2022
79f380e
name Threads
awidesky Oct 1, 2022
d10b70b
change version number
awidesky Oct 1, 2022
47b5b3b
Merge pull request #3 from awidesky/dev-synctask
shivam1608 Oct 1, 2022
8d83907
fixed pr3
shivam1608 Oct 1, 2022
e8f9297
Updated Version
shivam1608 Oct 1, 2022
9c97b1a
Update README.md
shivam1608 Oct 2, 2022
a45ded1
Added EventListener
shivam1608 Oct 8, 2022
b13ecd6
Fix:Patch Request
shivam1608 Oct 8, 2022
30e1ed3
Added Checks
shivam1608 Oct 8, 2022
ca0ae95
Added: EventListener
shivam1608 Oct 8, 2022
dcc075a
Fix: Naming Convention
shivam1608 Oct 8, 2022
dc5ec13
Removed Old Docs
shivam1608 Oct 8, 2022
49eda7e
Added EventListener
shivam1608 Oct 8, 2022
106e5c0
Update: Docs
shivam1608 Oct 8, 2022
f70c473
Update: EventListener
shivam1608 Oct 8, 2022
259b816
Update: Java Docs
shivam1608 Oct 8, 2022
6fc9333
Update: Version
shivam1608 Oct 8, 2022
40f762b
Add: JMailTM.jar
shivam1608 Oct 8, 2022
c82ac33
Merge branch 'main' of https://github.com/shivam1608/JMailTM
shivam1608 Oct 8, 2022
56c278c
Update README.md
shivam1608 Oct 8, 2022
184c237
Added: onAccountUpdate Event
shivam1608 Nov 6, 2022
eefb1aa
Update: Bind to Logger
shivam1608 Nov 6, 2022
14ea9f9
Fixed: Documentation
shivam1608 Nov 6, 2022
cd4f62b
Updated: Documentation
shivam1608 Nov 6, 2022
29ec36c
Updated: Version
shivam1608 Nov 6, 2022
73ca7fc
Updated: Version
shivam1608 Nov 6, 2022
dcde9ec
1. Added status code 429 Exception
Nov 11, 2022
0aeeef0
Updated as per comment
Nov 13, 2022
cad6af6
Merge pull request #4 from vigneshwarn/main
shivam1608 Nov 13, 2022
52aea60
Updated: Version
shivam1608 Dec 25, 2022
f5ca7f0
Added: Examples Directory
shivam1608 Dec 25, 2022
4ebdd37
Added: Login with Token
shivam1608 Dec 25, 2022
dcdbbd7
Updated: JavaDocs
shivam1608 Dec 25, 2022
1c379fb
Update README.md
shivam1608 Dec 25, 2022
2645137
Added if condition for hasAttachments (#6)
aarahmanqa Oct 30, 2023
bf22b1c
Null checks on fields (#7)
aarahmanqa May 19, 2024
329c86c
Update readme tags
shivam1608 Jun 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
.idea
.idea
/.project

# Eclipse
/.classpath
/JMailTM.eml
/JMailTM.userlibraries
.settings/
/target/
287 changes: 171 additions & 116 deletions .idea/workspace.xml

Large diffs are not rendered by default.

82 changes: 58 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
![JitPack](https://img.shields.io/jitpack/v/github/shivam1608/JMailTM?color=blue&logo=jitpack&style=for-the-badge)
![GitHub repo size](https://img.shields.io/github/repo-size/shivam1608/JMailTM?style=for-the-badge)
![JitPack](https://img.shields.io/jitpack/v/github/shivam1608/JMailTM?label=Build&logo=github&style=for-the-badge)
![Maintenance](https://img.shields.io/maintenance/yes/2021?logo=github&style=for-the-badge)
![Maintenance](https://img.shields.io/maintenance/yes/2024?logo=github&style=for-the-badge)

# JMailTM
JMailTM is a Lightweight Java Wrapper for https://mail.tm API (A Temp Mail Service). It has a easy to use interface and callbacks with javaDoc.

### Version : 0.2

### Version : 0.7.0
### Java 8 or 8+ Required
### Special Thanks to Mail.tm Team
<img src="thanks.png" width="500" height="300">

Expand All @@ -26,7 +26,7 @@ allprojects {
- Add the dependency (replace version with the version on top)
```gradle
dependencies {
implementation 'com.github.shivam1608:JMailTM:0.2'
implementation 'com.github.shivam1608:JMailTM:0.7.0'
}
```

Expand All @@ -47,7 +47,7 @@ dependencies {
<dependency>
<groupId>com.github.shivam1608</groupId>
<artifactId>JMailTM</artifactId>
<version>0.2</version>
<version>0.7.0</version>
</dependency>


Expand All @@ -64,52 +64,77 @@ out/artifact/JMailTM.jar or Use the Release Section

# Ouick Start
- Open a Message Listener with a new Temp EMail

```java
import me.shivzee.JMailTM;
import me.shivzee.callbacks.MessageListener;
import me.shivzee.callbacks.EventListener;
import me.shivzee.util.JMailBuilder;
import me.shivzee.util.Message;

import javax.security.auth.login.LoginException;

public class JMailService {
public static void main(String[] args) {
public static void main(String[] args) {
try {
JMailTM mailer = JMailBuilder.createDefault("randomPassword");
mailer.init();
System.out.println("Email : "+mailer.getSelf().getEmail());
System.out.println("Email : " + mailer.getSelf().getEmail());

mailer.openMessageListener(new MessageListener() {
mailer.openEventListener(new EventListener() {
@Override
public void onMessageReceived(Message message) {
System.out.println("Message Has Attachments ? : "+message.hasAttachments());
System.out.println("Message Content : "+message.getContent());
System.out.println("Message RawHTML : "+message.getRawHTML());
System.out.println("Message Has Attachments ? : " + message.hasAttachments());
System.out.println("Message Content : " + message.getContent());
System.out.println("Message RawHTML : " + message.getRawHTML());
// To Mark Message As Read
message.markAsRead(status->{
System.out.println("Message "+message.getId()+" Marked As Read");
message.markAsRead(status -> {
System.out.println("Message " + message.getId() + " Marked As Read");
});
}

@Override
public void onError(String error) {
System.out.println("Some Error Occurred "+error);
System.out.println("Some Error Occurred " + error);
}
});

}catch (LoginException exception){
System.out.println("Exception Caught "+exception);
} catch (LoginException exception) {
System.out.println("Exception Caught " + exception);
}
}

}
```
## Event Listener Interface
- All Overridable Methods
```java
mailer.openEventListener(new EventListener() {

@Override
public void onReady() {}

@Override
public void onMessageReceived(Message message) {}

@Override
public void onMessageDelete(String id) {}

@Override
public void onMessageSeen(Message message) {}

@Override
public void onAccountDelete(Account account) {}

@Override
public void onError(String error) {}
});
```

## Some Common Methods/Functions
- Get Details of Email
```java

mailer.openMessageListener(new MessageListener() {
mailer.openEventListener(new EventListener() {
@Override
public void onMessageReceived(Message message) {
String sender = message.getSenderAddress();
Expand All @@ -132,11 +157,17 @@ mailer.openMessageListener(new MessageListener() {
### Some Common Implementation of Message Class Functions
```java
message.markAsRead(status->{
if(status) System.out.println("Message Marked as Read");
});
if(status) System.out.println("Message Marked as Read");
});
message.asyncMarkAsRead(status->{
if(status) System.out.println("Message Marked as Read");
});
message.delete(status->{
if(status) System.out.println("Message was Deleted");
});
if(status) System.out.println("Message was Deleted");
});
message.asyncDelete(status->{
if(status) System.out.println("Message was Deleted");
});

```

Expand Down Expand Up @@ -289,7 +320,7 @@ mailer.init();
```java

//First Fetch Domain
JMailTM mailer = JMailBuilder.createAndLogin("thisismychoice@"+ Domains.getRandomDomain() , "MyPassword");
JMailTM mailer = JMailBuilder.createAndLogin("thisismychoice@"+ Domains.getRandomDomain().getDomainName() , "MyPassword");
mailer.init();

//Can Fetch Domains by List Too (Fetches the Domains)
Expand Down Expand Up @@ -320,11 +351,14 @@ mailer.delete(status->{
[JMailTM JavaDocs](https://shivam1608.github.io/JMailTM/)

## Open Source Project
Author : Shizee
Author : Shivzee
<br />
IDE Used : IntelliJ

### Dependencies
[JSONSimple](https://github.com/fangyidong/json-simple)
<br>
[Okhttp](https://square.github.io/okhttp/)



25 changes: 17 additions & 8 deletions docs/allclasses-index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Fri Apr 22 20:32:50 IST 2022 -->
<!-- Generated by javadoc (17) on Sun Dec 25 13:03:21 IST 2022 -->
<title>All Classes and Interfaces</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-04-22">
<meta name="dc.created" content="2022-12-25">
<meta name="description" content="class index">
<meta name="generator" content="javadoc/AllClassesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
Expand Down Expand Up @@ -37,6 +37,7 @@
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html#all-classes">Help</a></li>
</ul>
Expand Down Expand Up @@ -78,20 +79,28 @@ <h1 title="All Classes and Interfaces" class="title">All Classes and Interfaces<
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">The Config Class for Global Data</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="me/shivzee/util/Domain.html" title="class in me.shivzee.util">Domain</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="col-first even-row-color all-classes-table all-classes-table-tab5"><a href="me/shivzee/exceptions/DateTimeParserException.html" title="class in me.shivzee.exceptions">DateTimeParserException</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab5">
<div class="block">Created By vigneshwaranthangavelu @ 13/11/22 - 8:34 pm</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="me/shivzee/util/Domain.html" title="class in me.shivzee.util">Domain</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">The Domain Class to Wrap Domains
Check https://api.mail.tm for more info</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab5"><a href="me/shivzee/exceptions/DomainNotFoundException.html" title="class in me.shivzee.exceptions">DomainNotFoundException</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab5">
<div class="col-first even-row-color all-classes-table all-classes-table-tab5"><a href="me/shivzee/exceptions/DomainNotFoundException.html" title="class in me.shivzee.exceptions">DomainNotFoundException</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab5">
<div class="block">Thrown When the Domain is Not Found or Does not Exists</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="me/shivzee/util/Domains.html" title="class in me.shivzee.util">Domains</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="me/shivzee/util/Domains.html" title="class in me.shivzee.util">Domains</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">The Domains Class Static functions for Domain Operations
Check https://api.mail.tm for more info</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab1"><a href="me/shivzee/callbacks/EventListener.html" title="interface in me.shivzee.callbacks">EventListener</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab1">
<div class="block">EventListener Interface to listen to Events : delete,received, etc</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="me/shivzee/io/IO.html" title="class in me.shivzee.io">IO</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">The IO Class Written Specifically for JMailTM
Expand Down
5 changes: 3 additions & 2 deletions docs/allpackages-index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Fri Apr 22 20:32:50 IST 2022 -->
<!-- Generated by javadoc (17) on Sun Dec 25 13:03:21 IST 2022 -->
<title>All Packages</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-04-22">
<meta name="dc.created" content="2022-12-25">
<meta name="description" content="package index">
<meta name="generator" content="javadoc/AllPackagesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
Expand Down Expand Up @@ -33,6 +33,7 @@
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html#all-packages">Help</a></li>
</ul>
Expand Down
5 changes: 3 additions & 2 deletions docs/constant-values.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Fri Apr 22 20:32:50 IST 2022 -->
<!-- Generated by javadoc (17) on Sun Dec 25 13:03:21 IST 2022 -->
<title>Constant Field Values</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-04-22">
<meta name="dc.created" content="2022-12-25">
<meta name="description" content="summary of constants">
<meta name="generator" content="javadoc/ConstantsSummaryWriterImpl">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
Expand Down Expand Up @@ -33,6 +33,7 @@
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html#constant-values">Help</a></li>
</ul>
Expand Down
Loading