Package org.apache.commons.mail

Examples of org.apache.commons.mail.SimpleEmail.addTo()


        email.setSubject(buildSubject(stream, checkResult, configuration, backlog));

        StringBuilder body = new StringBuilder();
        body.append(buildBody(stream, checkResult, backlog));
        email.setMsg(body.toString());
        email.addTo(emailAddress);

        email.send();
    }

    protected String buildSubject(Stream stream, AlertCondition.CheckResult checkResult, Configuration config, List<Message> backlog) {
View Full Code Here


                simpleEmail.setAuthentication(authenticationName, authenticationPassword);
            }
            for (Address address : emailObject.getTo()) {
                String name = address.getName();
                if (name == null) {
                    simpleEmail.addTo(address.getEmailAddress());
                } else {
                    simpleEmail.addTo(address.getEmailAddress(), name);
                }
            }
            Address from = emailObject.getFrom();
View Full Code Here

            for (Address address : emailObject.getTo()) {
                String name = address.getName();
                if (name == null) {
                    simpleEmail.addTo(address.getEmailAddress());
                } else {
                    simpleEmail.addTo(address.getEmailAddress(), name);
                }
            }
            Address from = emailObject.getFrom();
            if (from == null) {
                simpleEmail.setFrom(fromEmailAddress, fromName);
View Full Code Here

             "mail.smtp.starttls.enable", "true");
    }
        email.setFrom(from, "Wookie Server");
        email.setSubject("Wookie API Key");
        email.setMsg(message);
        email.addTo(to);
        email.send();
  }

}
View Full Code Here

            email.setHostName("localhost");
            email.setSmtpPort(2525);
            email.setFrom(options.getFromEmail(), options.getFromName());
            email.setSubject("[test] " + render(options.getSubjectTemplate(), context));
            email.setMsg(render(options.getBodyTemplate(), context));
            email.addTo(toEmail);
            if (options.getReplyToEmail() != null)
            {
                email.setReplyTo(Arrays.asList(new InternetAddress(options.getReplyToEmail())));
            }
View Full Code Here

             "mail.smtp.starttls.enable", "true");
    }
        email.setFrom(from, "Wookie Server");
        email.setSubject("Wookie API Key");
        email.setMsg(message);
        email.addTo(to);
        email.send();
  }

}
View Full Code Here

        + (currentUser != null ? currentUser : "UNLOGGED") + "\nException: \n" + stackTrace;
  }

  public SimpleEmail toSimpleMail() throws EmailException {
    SimpleEmail email = new SimpleEmail();
    email.addTo(to);
    email.setSubject(subject);
    email.setMsg(getMsg());
    email.setFrom(from, fromName);
    return email;
  }
View Full Code Here

                   
        try{
            SimpleEmail email = new SimpleEmail();
            email.setHostName("smtp.gmail.com");
            email.setSmtpPort(465);
            email.addTo(endEmail);
            email.setFrom("compartilhartrabalhos@gmail.com", "BSI");
            email.setSubject("Voce tem um novo RMP");
            email.setMsg(textoEmail);
            email.setSSL(true);
            email.setAuthentication("compartilhartrabalhos@gmail.com", "bsi2012102");
View Full Code Here

             "mail.smtp.starttls.enable", "true");
    }
        email.setFrom(from, "Wookie Server");
        email.setSubject("Wookie API Key");
        email.setMsg(message);
        email.addTo(to);
        email.send();
  }

}
View Full Code Here

                 setFrom("miguelvega.name@gmail.com").setHostName("smtp.googlemail.com").setSSL(true).setSmtpPort(465);
        SimpleEmail simpleEmail = emailConfig.newSimpleEmail();

        simpleEmail.setSubject("hello world!");
        simpleEmail.setMsg("This is a simple plain text email");
        simpleEmail.addTo("mikevegap@gmail.com", "mike");

        simpleEmail.send();
    }
}
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.