MailWrapper { public void sendText(String to, String subj, String body) throws Exception { client.sendText(to, subj, body); } MailWrapper(MailProperties mailProperties, String productName); void sendReportEmail(String to,
                                String subj,
                                String downloadUrl,
                                String dynamicSection); void sendText(String to, String subj, String body); void sendHtml(String to, String subj, String body); void sendWithAttachment(String to, String subj, String body, QrHolder attachment); void sendWithAttachment(String to, String subj, String body, QrHolder[] attachments);  }
@Test @Ignore public void sendMail() throws Exception { MailProperties properties = new MailProperties(Collections.emptyMap()); try (InputStream classPath = MailWrapperTest.class.getResourceAsStream("/mail.properties")) { if (classPath != null) { properties.load(classPath); } } String to = ""; MailWrapper mailWrapper = new MailWrapper(properties, AppNameUtil.BLYNK); mailWrapper.sendText(to, "Hello", "Body!"); }
@Test @Ignore public void sendMail2() throws Exception { MailProperties properties = new MailProperties(Collections.emptyMap()); try (InputStream classPath = MailWrapperTest.class.getResourceAsStream("/mail.properties")) { if (classPath != null) { properties.load(classPath); } } String to = "doom369@gmail.com"; MailWrapper mailWrapper = new MailWrapper(properties, AppNameUtil.BLYNK); mailWrapper.sendText(to, "Hello", "Body!"); }
@Test @Ignore public void sendMailWithHttpProvider() throws Exception { MailProperties properties = new MailProperties(Collections.emptyMap()); try (InputStream classPath = MailWrapperTest.class.getResourceAsStream("/mail.properties")) { if (classPath != null) { properties.load(classPath); } } String to = ""; MailWrapper mailWrapper = new MailWrapper(properties, AppNameUtil.BLYNK); mailWrapper.sendText(to, "Hello", "Happy Blynking!\n" + "-\n" + "Getting Started Guide -> https: "Documentation -> http: "Sketch generator -> https: "\n" + "Latest Blynk library -> https: "Latest Blynk server -> https: "-\n" + "https: "twitter.com/blynk_app\n" + "www.facebook.com/blynkapp"); }