Advertisement
KahnClifford

MailAPI.java (Subject doesn't work)

Jul 31st, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1.  
  2. package controller;
  3.  
  4. import static java.lang.ProcessBuilder.Redirect.from;
  5. import java.util.Properties;
  6. import javax.mail.PasswordAuthentication;
  7. import javax.mail.Session;
  8.  
  9. public class MailAPI {
  10.  
  11.  
  12. private model.MailAPI model;
  13. private String errorMsg;
  14.  
  15.  
  16. public MailAPI() {
  17. model = new model.MailAPI();
  18. }
  19.  
  20. public MailAPI(String prmEmail, char[] prmPassword) {
  21. model = new model.MailAPI(prmEmail, prmPassword);
  22. }
  23.  
  24.  
  25. public String getError(){
  26. return model.getError();
  27. }
  28.  
  29.  
  30. public String getTo(){
  31. return model.getTo();
  32. }
  33.  
  34.  
  35. public String getFrom(){
  36. return model.getFrom();
  37. }
  38.  
  39.  
  40. public boolean emptyPassword(){
  41. return model.emptyPassword();
  42. }
  43.  
  44.  
  45. public void getEmails(){
  46. model.getEmails();
  47. }
  48.  
  49.  
  50. public void sendMsg(String prmSub, String prmMsg){
  51. model.sendMsg(prmMsg, prmMsg);
  52. }
  53.  
  54.  
  55. public void setRecipient(String prmTo){
  56. model.setRecipient(prmTo);
  57. }
  58.  
  59. public static void main(String[] args) {
  60. controller.MailAPI mail = new controller.MailAPI();
  61. mail.setRecipient("kahnclifford@gmail.com");
  62. mail.sendMsg("Test Subject here...", "Test Message Body here...");
  63. }
  64. }
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement