Examples of SMTPConfiguration


Examples of com.hubspot.singularity.config.SMTPConfiguration

    MesosConfiguration mc = new MesosConfiguration();
    mc.setDefaultCpus(1);
    mc.setDefaultMemory(128);
    config.setMesosConfiguration(mc);

    config.setSmtpConfiguration(new SMTPConfiguration());

    ZooKeeperConfiguration zookeeperConfiguration = new ZooKeeperConfiguration();
    zookeeperConfiguration.setQuorum(ts.getConnectString());

    config.setZooKeeperConfiguration(zookeeperConfiguration);
View Full Code Here

Examples of com.hubspot.singularity.config.SMTPConfiguration

      return Session.getInstance(properties);
    }
  }

  private void sendMail(List<String> toList, List<String> ccList, String subject, String body) {
    final SMTPConfiguration smtpConfiguration = maybeSmtpConfiguration.get();

    boolean useAuth = false;

    if (smtpConfiguration.getUsername().isPresent() && smtpConfiguration.getPassword().isPresent()) {
      useAuth = true;
    } else if (smtpConfiguration.getUsername().isPresent() || smtpConfiguration.getPassword().isPresent()) {
      LOG.warn("Not using smtp authentication because username ({}) or password ({}) was not present", smtpConfiguration.getUsername().isPresent(), smtpConfiguration.getPassword().isPresent());
    }

    try {
      final Session session = createSession(maybeSmtpConfiguration.get(), useAuth);

      MimeMessage message = new MimeMessage(session);

      Address[] toArray = getAddresses(toList);
      message.addRecipients(RecipientType.TO, toArray);

      if (!ccList.isEmpty()) {
        Address[] ccArray = getAddresses(ccList);
        message.addRecipients(RecipientType.CC, ccArray);
      }

      message.setFrom(new InternetAddress(smtpConfiguration.getFrom()));

      message.setSubject(MimeUtility.encodeText(subject, "utf-8", null));
      message.setContent(body, "text/html; charset=utf-8");

      LOG.trace("Sending a message to {} - {}", Arrays.toString(toArray), getEmailLogFormat(toList, subject));
View Full Code Here

Examples of org.apache.james.protocols.smtp.SMTPConfiguration

        };
        return table;
    }
   
    private SMTPConfiguration setupMockedSMTPConfiguration() {
        SMTPConfiguration conf = new SMTPConfiguration() {
           
       
            public String getHelloName() {
                throw new UnsupportedOperationException("Unimplemented Stub Method");
            }
View Full Code Here

Examples of org.apache.james.protocols.smtp.SMTPConfiguration

        };
        return table;
    }
   
    private SMTPConfiguration setupMockedSMTPConfiguration() {
        SMTPConfiguration conf = new SMTPConfiguration() {
           
       
            public String getHelloName() {
                throw new UnsupportedOperationException("Unimplemented Stub Method");
            }
View Full Code Here

Examples of org.apache.james.protocols.smtp.SMTPConfiguration

        };
        return table;
    }

    private SMTPConfiguration setupMockedSMTPConfiguration() {
        SMTPConfiguration conf = new SMTPConfiguration() {

            @Override
            public String getHelloName() {
                throw new UnsupportedOperationException("Unimplemented Stub Method");
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.