Package org.apache.commons.mail

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


    public void buildValidMessages() throws EmailException {
        new YalpBuilder().build();

        Email email = new SimpleEmail();
        email.setFrom("from@yalpframework.com");
        email.addTo("to@yalpframework.com");
        email.setSubject("subject");
        Mail.buildMessage(email);

        email = new SimpleEmail();
        email.setFrom("from@yalpframework.com");
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

  @Override
  public Email to(String name, String toMail) {
    SimpleEmail email = new SimpleEmail();
    try {
      email.addTo(toMail, name);
    } catch (EmailException e) {
      throw new IllegalArgumentException(e);
    }
    return email;
  }
View Full Code Here

  @Override
  public Email to(String name, String toMail) {
    SimpleEmail email = new SimpleEmail();
    try {
      email.addTo(toMail, name);
    } catch (EmailException e) {
      throw new IllegalArgumentException(e);
    }
    return email;
  }
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

  @Override
  public Email to(String name, String toMail) {
    SimpleEmail email = new SimpleEmail();
    try {
      email.addTo(toMail, name);
    } catch (EmailException e) {
      throw new IllegalArgumentException(e);
    }
    return email;
  }
View Full Code Here

                    .append("You can login using the following credentials: username: ").append(emailDetail.getUsername())
                    .append(" password: ").append(unencodedPassword);

            email.setMsg(messageBuilder.toString());

            email.addTo(sendToEmail, emailDetail.getContactName());
            email.send();
        } catch (final EmailException e) {
            throw new PlatformEmailSendException(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)
View Full Code Here

        }
      }

      try {
        email.setFrom(from);
        email.addTo(to);
        if(!StringUtils.isEmpty(subject)) email.setSubject(subject);
        if(!StringUtils.isEmpty(message)) email.setMsg(message);
        email.send();
        logger.debug("Sent email to '{}' with subject '{}'.", to, subject);
        success = true;
View Full Code Here

   
    public void enviarEmail(){
        try {
            SimpleEmail mailer = new SimpleEmail();
            mailer.setHostName(configuracao.getConSmtpServer());
            mailer.addTo(siteMB.getBean().getSitEmailContato());
            mailer.setFrom(email, nome);
            mailer.setSubject(assunto);
            mailer.setMsg(mensagem);
            mailer.setAuthentication(configuracao.getConSmtpUser(), configuracao.getConSmtpPassword());
           
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.