Package org.apache.commons.mail

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


  private SimpleEmail createEmailFor(String msg, Throwable e)
      throws EmailException {
    SimpleEmail email = new SimpleEmail();
    String mailingList = env.get(TARGET_MAILING_LIST);
    email.addTo(mailingList);
    email.setSubject("production error");
    email.setMsg(msg + "\nException: \n" + stackAsString(e));
    String from = env.get("vraptor.simplemail.main.from");
    String fromName = env.get("vraptor.simplemail.main.from.name");
    email.setFrom(from, fromName);
View Full Code Here


  @Test(expected = MailException.class)
  public void buildMessageWithoutFrom() throws EmailException {
    new PlayBuilder().build();

    Email email = new SimpleEmail();
    email.addTo("from@playframework.org");
    email.setSubject("subject");
    Mail.buildMessage(new SimpleEmail());
  }

  @Test(expected = MailException.class)
View Full Code Here

  public void buildMessageWithoutSubject() throws EmailException {
    new PlayBuilder().build();

    Email email = new SimpleEmail();
    email.setFrom("from@playframework.org");
    email.addTo("to@playframework.org");
    Mail.buildMessage(email);
  }

  @Test
  public void buildValidMessages() throws EmailException {
View Full Code Here

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

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

    email = new SimpleEmail();
    email.setFrom("from@playframework.org");
View Full Code Here

      email.setSSL(mailInfo.getIsSSL()); // 设定是否使用SSL
      email.setSslSmtpPort(mailInfo.getSslSmtpPort()); // 设定SSL端口
      email.setAuthentication(mailInfo.getUserName(), mailInfo
          .getPassword()); // 设定smtp服务器的认证资料信息
      email.setDebug(mailInfo.getIsDebug()); // 是否用debug模式
      email.addTo(mailInfo.getToAddress(), mailInfo.getToName()); // 设定收件人
      email.setFrom(mailInfo.getFromAddress(), mailInfo.getFromName());
      email.setSubject(mailInfo.getSubject());
      email.setCharset(mailInfo.getCharset());// 设定内容的语言集
      email.setMsg(mailInfo.getContent());// 设定邮件内容
      email.send();// 发送邮件
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

         baseurl,
         fromDisplayName
           });

      email.setMailSession(session);
      email.addTo(to, toDisplayName);
      email.setFrom(from, fromDisplayName);
      email.setSubject(subject);
      email.setCharset("UTF-8");
      email.setMsg(content);
View Full Code Here

         fromDisplayName,
         profileInfo.get("id")
           });

      email.setMailSession(session);
      email.addTo(to, toDisplayName);
      email.setFrom(from, fromDisplayName);
      email.setSubject(subject);
      email.setCharset("UTF-8");
      email.setMsg(content);
View Full Code Here

         fromDisplayName,
         newPassword
           });

      email.setMailSession(session);
      email.addTo(to, toDisplayName);
      email.setFrom(from, fromDisplayName);
      email.setSubject(subject);
      email.setCharset("UTF-8");
      email.setMsg(content);
View Full Code Here

    email.setMailSession(session);
    email.setFrom(from, fromDisplayName);
    email.setSubject(subject);
    email.setCharset("UTF-8");
    email.setMsg(content);
    email.addTo(addr, displayName);

    email.send();
      } // end of while
  } catch (Exception e) {
      e.printStackTrace();
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.