Yopmail (Your Own Protection mail) is a temporary e-mail service. They keep a message up for 8 days. From wikia.com
This tool was made for people who wants to automate certain task involving email reception. I were looking for a similar tool like this but was not lucky. So i am sharing my yopmail reader for the comunity.
- List first incoming emails
- List incoming emails from a specific page
- Get the content of a specific email received (from one mail in above list)
- Get the content of the last email received
This tool was designed following the singleton pattern. From wikipedia:
The singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The concept is sometimes generalized to systems that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects. The term comes from the mathematical concept of a singleton.
An example of utilization could be:
import java.io.IOException;
import java.util.List;
import com.AngelBarreraSanchez.Yopmail.Domain.Mail;
public class Example {
public static void main(String[] args) {
final String myYopMail = "abasanchez@yopmail.com";
final YopmailReader yopmailReader = YopmailReader.getInstance();
try {
// Getting the content of the lastmail received
final String lastMailContent = yopmailReader.getLastMailContent(myYopMail);
System.out.println("Last email content: " );
System.out.println(lastMailContent);
// Getting the first 15 received mails
List<Mail> listMail = yopmailReader.getIncomingMailList(myYopMail);
for(final Mail mail : listMail){
System.out.println("Mail from: " + mail.getSender());
System.out.println("Mail subject: " + mail.getSubject());
System.out.println("Mail content: ");
System.out.println(yopmailReader.getMailContent(mail));
}
final int page = 2;
// Getting the next 15 received mails (page 2)
listMail = yopmailReader.getIncomingMailList(myYopMail, page);
for(final Mail mail : listMail){
System.out.println("Mail from: " + mail.getSender());
System.out.println("Mail subject: " + mail.getSubject());
System.out.println("Mail content: ");
System.out.println(yopmailReader.getMailContent(mail));
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
0.0.1-SNAPSHOT
During the testing phase, they blocked me from accessing to the YopMail web, now all time i am trying to enter its site i have got a 403 error. You know, a stress test can make yopmail to understand you are trying to attack its site. So, use this tool with head before getting your ip banned.
Another thing to know is the probability to request mail content and get an IOException. This could be because sometimes, randomly, yopmail request you to resolve a captcha.
- Get the date and time of a received mail
- Send mails to another yopmails accounts
- Analyze a way to avoid captchas requests
- Improve the times of dom navigation
- Push to maven repo
Want to contribute? Great! I will wait your pull requests :)