protected Future<Boolean> send(MailPlugin plugin) throws IOException, MessagingException { return plugin.send(Arrays.asList("dst@gmail.com"), "Testing Subject", "Dear Mail Crawler," + "\n\n No spam to my email, please!"); }
@Override protected Future<Boolean> send(MailPlugin plugin) throws IOException, MessagingException { return plugin.send(Arrays.asList("dst@gmail.com"), "Testing Subject", "<html><body>hello wolrd</body></html>", "text/html;charset=UTF-8"); }
@Override protected Future<Boolean> send(MailPlugin plugin) throws IOException, MessagingException { return plugin.send(Arrays.asList("dst@gmail.com"), "Testing Subject", "Dear Mail Crawler," + "\n\n No spam to my email, please!", new FileDataSource(f)); } @Override
public Future<Boolean> send( Iterable<String> recipients, final String subject, final Object body, final String type, final DataSource... attachments) throws MessagingException { // final InternetAddress[] addresses = InternetAddress.parse(Utils.join(recipients, ",")); // Callable<Boolean> f = (new Callable<Boolean>() { public Boolean call() throws Exception { Properties props = new Properties(); props.setProperty("mail.smtp.host", smtpHost); if (smtpPort != null) { props.setProperty("mail.smtp.port", Integer.toString(smtpPort)); } // final String username = smtpUsername, password = smtpPassword; Authenticator authenticator; if (username != null && password != null) { props.setProperty("mail.smtp.auth", "true"); authenticator = new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } };
public Future<Boolean> send( Iterable<String> recipients, final String subject, final Object body, final String type, final DataSource... attachments) throws MessagingException { // final InternetAddress[] addresses = InternetAddress.parse(Strings.join(recipients, ",")); // Callable<Boolean> f = (new Callable<Boolean>() { public Boolean call() throws Exception { Properties props = new Properties(); props.setProperty("mail.smtp.host", smtpHost); if (smtpPort != null) { props.setProperty("mail.smtp.port", Integer.toString(smtpPort)); } // final String username = smtpUsername, password = smtpPassword; Authenticator authenticator; if (username != null && password != null) { props.setProperty("mail.smtp.auth", "true"); authenticator = new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } };
public Future<Boolean> send( Iterable<String> recipients, final String subject, final Object body, final String type, final DataSource... attachments) throws MessagingException { // final InternetAddress[] addresses = InternetAddress.parse(Utils.join(recipients, ",")); // Callable<Boolean> f = (new Callable<Boolean>() { public Boolean call() throws Exception { Properties props = new Properties(); props.setProperty("mail.smtp.host", smtpHost); if (smtpPort != null) { props.setProperty("mail.smtp.port", Integer.toString(smtpPort)); } // final String username = smtpUsername, password = smtpPassword; Authenticator authenticator; if (username != null && password != null) { props.setProperty("mail.smtp.auth", "true"); authenticator = new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } };