Examples of Mail


Examples of com.centraview.mail.Mail

    // "mailAccountListform" defined in struts-config-preference.xml
    DynaActionForm accountForm = (DynaActionForm)form;
   
    try {
      MailHome home = (MailHome)CVUtility.getHomeObject("com.centraview.mail.MailHome", "Mail");
      Mail remote = (Mail)home.create();
      remote.setDataSource(dataSource);

      ArrayList accountList = new ArrayList();

      ArrayList accountIDList = remote.getUserAccountList(individualID);
      Iterator iter = accountIDList.iterator();
     
      while (iter.hasNext()) {
        Number accountID = (Number)iter.next();
       
        if (accountID != null && accountID.intValue() > 0) {
          MailAccountVO accountVO = remote.getMailAccountVO(accountID.intValue());
          accountList.add(accountVO);
        }
      }
     
      accountForm.set("accountList", accountList);
View Full Code Here

Examples of com.centraview.mail.Mail

        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Import Type"));
        return(mapping.findForward(forward));
      }
     
      MailHome home = (MailHome)CVUtility.getHomeObject("com.centraview.mail.MailHome", "Mail");
      Mail remote = (Mail)home.create();
      remote.setDataSource(dataSource);

      MailMessageVO messageVO = remote.getEmailMessageVO(individualID, messageID.intValue());

      String body = (String)messageVO.getBody();

      MailImportHome importHome = (MailImportHome)CVUtility.getHomeObject("com.centraview.mail.MailImportHome", "MailImport");
      MailImport importRemote = (MailImport)importHome.create();
View Full Code Here

Examples of com.centraview.mail.Mail

        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Account ID"));
        return mapping.findForward(forward);
      }

      MailHome home = (MailHome)CVUtility.getHomeObject("com.centraview.mail.MailHome", "Mail");
      Mail remote = (Mail)home.create();
      remote.setDataSource(dataSource);

      MailAccountVO accountVO = remote.getMailAccountVO(accountID.intValue());

      accountForm.set("accountName", accountVO.getAccountName());
      accountForm.set("emailAddress", accountVO.getEmailAddress());
      accountForm.set("replyTo", accountVO.getReplyToAddress());
      accountForm.set("serverType", accountVO.getAccountType());
View Full Code Here

Examples of com.centraview.mail.Mail

        // no point in continuing forward. Show user the door. :-)
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Account ID"));
        return mapping.findForward(forward);
      }

      Mail remote = (Mail)home.create();
      remote.setDataSource(dataSource);

      MailAccountVO accountVO = remote.getMailAccountVO(accountID.intValue());

      // account name - required
      String accountName = (String)accountForm.get("accountName");
      if (accountName == null || accountName.length() <= 0) {
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Account Name"));
      }
      accountVO.setAccountName(accountName);

      // email address - must be a valid InternetAddress
      String emailAddress = (String)accountForm.get("emailAddress");
      if (emailAddress == null) {
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Email Address"));
      } else if (! CVUtility.isEmailAddressValid(emailAddress)) {
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.email.invalidAddress", emailAddress));
      }
      accountVO.setEmailAddress(emailAddress);

      // leave on server - false by default
      Boolean leaveOnServerForm = (Boolean)accountForm.get("leaveOnServer");
      boolean leaveOnServer = false;
      if (leaveOnServerForm != null && leaveOnServerForm.booleanValue() == true) {
        leaveOnServer = true;
      }
      accountVO.setLeaveMessagesOnServer(leaveOnServer);

      // user name - required
      String username = (String)accountForm.get("username");
      if (username == null || username.length() <= 0) {
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "User Name (login)"));
      }
      accountVO.setLogin(username);

      // password - required
      String password = (String)accountForm.get("password");
      if (password == null || password.length() <= 0) {
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Password"));
      }
      accountVO.setPassword(password);

      // mail server (POP3 or IMAP) - required
      String mailServer = (String)accountForm.get("mailServer");
      if (mailServer == null || mailServer.length() <= 0) {
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Mail Server Address"));
      }
      accountVO.setMailServer(mailServer);

      // reply to - optional
      String replyTo = (String)accountForm.get("replyTo");
      accountVO.setReplyToAddress(replyTo);

      // signature - optional
      String signature = (String)accountForm.get("signature");
      accountVO.setSignature(signature);

      // port - required, must be valid Integer
      Integer smtpPort = (Integer)accountForm.get("port");
      if (smtpPort == null || smtpPort.intValue() <= 0) {
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "SMTP Port"));
      }
      accountVO.setSmtpPort(smtpPort.intValue());

      // smtp server - required
      String smtpServer = (String)accountForm.get("smtpServer");
      if (smtpServer == null || smtpServer.length() <= 0) {
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "SMTP Server"));
      }
      accountVO.setSmtpServer(smtpServer);

      accountVO.setAuthenticationRequiredForSMTP(false);    // set false by default
      Boolean authenticationRequiredForSMTP = (Boolean)accountForm.get("authenticationRequiredForSMTP");
      if (authenticationRequiredForSMTP != null) {
        if (authenticationRequiredForSMTP.booleanValue()) {
          accountVO.setAuthenticationRequiredForSMTP(true);
        }
      }

      if (! allErrors.isEmpty()) {
        saveErrors(request, allErrors);
        return mapping.findForward(forward);
      }
     
      try {
        remote.updateEmailAccount(accountVO);
      } catch (MessagingException me) {
        String errorMessage = me.getMessage();
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "Error while updating email account, "+errorMessage));
        saveErrors(request, allErrors);
        return mapping.findForward(errorForward);
View Full Code Here

Examples of com.centraview.mail.Mail

        hm.put("sortType", new Character(sortType));
        HashMap listMap = null;

        try {
          MailHome home = (MailHome)CVUtility.getHomeObject("com.centraview.mail.MailHome", "Mail");
          Mail remote = (Mail)home.create();
          remote.setDataSource(this.dataSource);

          returnDL = (RuleList)remote.getRuleList(userID, accountID, hm);
        } catch (Exception e) {
          System.out.println("[Exception] ListGenerator.getRuleList: " + e.toString());
          // e.printStackTrace();
        }
View Full Code Here

Examples of com.centraview.mail.Mail

    hm.put("sortmem", paramDL.getSortMember());
    hm.put("sortType", new Character(paramDL.getSortType()));

    try {
      MailHome home = (MailHome)CVUtility.getHomeObject("com.centraview.mail.MailHome", "Mail");
      Mail remote = (Mail)home.create();
      remote.setDataSource(this.dataSource);
      returnDL = (RuleList)remote.getRuleList(userid, accountID, hm);
    } catch (Exception e) {
      System.out.println("[Exception] ListGenerator.getRuleList: " + e.toString());
      // e.printStackTrace();
    }
    // long currentListID = this.getNextListID();
View Full Code Here

Examples of com.crackj2ee.mail.Mail

    public void run() {
        MailEngine sender = new MailEngine();
        sender.setMxConfig(new MxConfig());

        // Create a new Mail:
        Mail mail = null;
        try {
            mail = Mail.buildTextMail(
                    "services-no-reply@gamesnet.net",
                    to,
                    "Welcome to GamesNET",
View Full Code Here

Examples of com.feth.play.module.mail.Mailer.Mail

   * @return The {@link akka.actor.Cancellable} that can be used to cancel the
   *         action.
   */
  protected Cancellable sendMail(final String subject, final Body body,
      final String recipient) {
    return sendMail(new Mail(subject, body, new String[] { recipient }));
  }
View Full Code Here

Examples of com.forgeessentials.chat.Mail

        for (int i = 1; i < args.length; i++)
        {
            cmd.append(args[i]);
            cmd.append(" ");
        }
        MailSystem.AddMail(new Mail("", sender.getCommandSenderName(), args[0], cmd.toString()));
        OutputHandler.chatConfirmation(sender, String.format("Posted message to %s.", args[0]));
    }
View Full Code Here

Examples of com.ourlinc.activity.Mail

      request.setAttribute("needAuth", needAuth);
      return "activity/sendemail";
    }
    // 发送邮件
    boolean flag = false;
    Mail mail = new Mail(email, password);
    try {
      if ("add".equals(op)) {
        mail.send(
            email,
            toAddresses,
            null,
            "活动通知",
            EmailTemplates.buildAddContent(act.getTime(),
                act.getTitle(), act.getId()));
      } else if ("edit".equals(op)) {
        mail.send(
            email,
            toAddresses,
            null,
            "活动修改通知",
            EmailTemplates.buildEditContent(act.getTime(),
                act.getTitle(),
                EmailConfig.getValue("editContent"),
                act.getId()));
      } else if ("cancel".equals(op)) {
        mail.send(
            email,
            toAddresses,
            null,
            "活动取消通知",
            EmailTemplates.buildCancelContent(act.getTime(),
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.