Package org.apache.commons.mail

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


            mail.setSmtpPort(port);
            mail.setCharset(HtmlEmail.ISO_8859_1);
            for (String t : tos) {
                try {
                    mail.addTo(t, t);
                } catch (EmailException ex) {
                    System.err.print(ex);
                    return false;
                }
            }
View Full Code Here


        email.setMailSession(session);

        email.setFrom("test_from@apache.org");
        email.setSubject("Test Subject");
        email.addTo("test_to@apache.org");

        email.buildMimeMessage();
        final MimeMessage msg = email.getMimeMessage();

        final MimeMessageParser mimeMessageParser = new MimeMessageParser(msg);
View Full Code Here

        email.setMailSession(session);

        email.setFrom("test_from@apache.org");
        email.setSubject("Test Subject");
        email.addTo("test_to@apache.org");
        email.setTextMsg("My test message");

        email.buildMimeMessage();
        final MimeMessage msg = email.getMimeMessage();
View Full Code Here

        email.setMailSession(session);

        email.setFrom("test_from@apache.org");
        email.setSubject("Test Subject");
        email.addTo("test_to@apache.org");
        email.setTextMsg("My test message");
        email.setHtmlMsg("<p>My HTML message</p>");

        email.buildMimeMessage();
        final MimeMessage msg = email.getMimeMessage();
View Full Code Here

    try {
     
      addEmbeddables(email);
      addAttachments(email);
     
      email.addTo(toMail, name);
      boolean hasNoSubjectDefined = this.localization.getMessage(templateName,
          nameParameters).equals("???" + templateName + "???");
      if (hasNoSubjectDefined) {
        throw new IllegalArgumentException(
            "Subject not defined for email template : " + templateName);
View Full Code Here

            message.setTLS(true);
            message.setFrom(from.getEmailAddress());
            message.setSubject(email.getTitle());
            message.setHtmlMsg(email.getContent());
            message.setMsg(email.getContent());
            message.addTo(email.getContact().getEmail());
            doSend(message);
        } catch (Exception e) {
            throw new RuntimeException("Unable to send mail", e);
        }
View Full Code Here

      if (content != null) {
        email.setHtmlMsg(content);
      }
      if (emails != null && emails.size() > 0) {
        for (String to : emails) {
          email.addTo(to);
        }
        email.send();
      }
      return true;
    } catch (Exception e) {
View Full Code Here

    HtmlEmail hemail = new HtmlEmail();
      try {
        hemail.setHostName(getHost(from));
      hemail.setSmtpPort(getSmtpPort(from));
        hemail.setCharset(charSet);
        hemail.addTo(toMailAddr);
        hemail.setFrom(from, fromName);
        hemail.setAuthentication(username, password);
        hemail.setSubject(subject);
        freeMarkerConfig = new Configuration();
        freeMarkerConfig.setDirectoryForTemplateLoading(new File(getFilePath()));
View Full Code Here

      HtmlEmail hemail = new HtmlEmail();
    try {
      hemail.setHostName(getHost(from));
      hemail.setSmtpPort(getSmtpPort(from));
      hemail.setCharset(charSet);
      hemail.addTo(toMailAddr);
      hemail.setFrom(from, fromName);
      hemail.setAuthentication(username, password);
      hemail.setSubject(subject);
      hemail.setMsg(message);
      hemail.send();
View Full Code Here

        attachment2.setName("fond3.jpg");
        attachment2.setPath(Play.applicationPath.getPath() + java.io.File.separator + "test" + java.io.File.separator + "fond3.jpg");
        email.attach(attachment);
        email.attach(attachment2);
        email.setFrom("test@localhost");
        email.addTo("test@localhost");
        email.setSubject("test attachments");
        Mail.send(email);
        renderText("OK5");
    }
   
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.