Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package controller;
- import static java.lang.ProcessBuilder.Redirect.from;
- import java.util.Properties;
- import javax.mail.PasswordAuthentication;
- import javax.mail.Session;
- public class MailAPI {
- private model.MailAPI model;
- private String errorMsg;
- public MailAPI() {
- model = new model.MailAPI();
- }
- public MailAPI(String prmEmail, char[] prmPassword) {
- model = new model.MailAPI(prmEmail, prmPassword);
- }
- public String getError(){
- return model.getError();
- }
- public String getTo(){
- return model.getTo();
- }
- public String getFrom(){
- return model.getFrom();
- }
- public boolean emptyPassword(){
- return model.emptyPassword();
- }
- public void getEmails(){
- model.getEmails();
- }
- public void sendMsg(String prmSub, String prmMsg){
- model.sendMsg(prmMsg, prmMsg);
- }
- public void setRecipient(String prmTo){
- model.setRecipient(prmTo);
- }
- public static void main(String[] args) {
- controller.MailAPI mail = new controller.MailAPI();
- mail.getEmails();
- }
- public boolean sendHashMsg(String prmEmail, int prmHash){
- if(prmEmail != null && prmHash != 0){
- this.setRecipient(prmEmail);
- String hashStr = String.valueOf(prmHash);
- this.sendMsg("Java Mail - Verification", hashStr);
- return true;
- }else{
- return false;
- }
- }
- }
Add Comment
Please, Sign In to add comment