Package org.apache.commons.mail

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


    try {
     
      addEmbeddables(email);
      addAttachments(email);
     
      email.addTo(toMail, name);
      email.setSubject(this.localization.getMessage(this.templateName, nameParameters));
      email.setHtmlMsg(this.template.getContent());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
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

        attachment2.setName("fond3.jpg");
        attachment2.setPath(Yalp.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

    try {
     
      addEmbeddables(email);
      addAttachments(email);
     
      email.addTo(toMail, name);
      email.setSubject(this.localization.getMessage(this.templateName, nameParameters));
      email.setHtmlMsg(this.template.getContent());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

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

      with("signer", this.localization.getMessage("signer"));
    }

    HtmlEmail email = new HtmlEmail();
    try {
      email.addTo(toMail, name);
      email.setSubject(this.localization.getMessage(this.templateName, nameParameters));
      email.setHtmlMsg(this.template.getContent());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

          {
            logger.error("Exception validating number of recipients in mailservice:" + e.getMessage(), e);
        }
        }
       
        email.addTo(to, to);
        email.setFrom(from, from);
        if(cc != null)
          email.setCc(createInternetAddressesList(cc));
        if(bcc != null)
          email.setBcc(createInternetAddressesList(bcc));
View Full Code Here

    try {
     
      addEmbeddables(email);
      addAttachments(email);
     
      email.addTo(toMail, name);
      email.setSubject(this.localization.getMessage(this.templateName, nameParameters));
      email.setHtmlMsg(this.template.getContent());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
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.