Examples of InternetAddress


Examples of javax.mail.internet.InternetAddress

  public static boolean isEmailAddressValid(String address)
  {
    boolean result = true;
    try {
      new InternetAddress(address);
    } catch (AddressException ae) {
      result = false;
    } catch (NullPointerException npe) {
      result = false;
    }
View Full Code Here

Examples of javax.mail.internet.InternetAddress

        while (iter.hasNext()) {
          Number accountID = (Number)iter.next();
          MailAccountVO accountVO = remote.getMailAccountVO(accountID.intValue());
          HashMap accountDetails = new HashMap();
          accountDetails.put("accountID", new Integer(accountID.intValue()));
          accountDetails.put("accountName", new InternetAddress(accountVO.getEmailAddress(), mailUtils.stripInvalidCharsFromName(accountVO.getIndividualName())));
          accountList.add(accountDetails);
        }
      }
      emailForm.set("accountList", accountList);
View Full Code Here

Examples of javax.mail.internet.InternetAddress

        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "Could not retreive account information. Please select an account."));
      }

      MailUtils mailUtils = new MailUtils();

      InternetAddress fromAddress = new InternetAddress(accountVO.getEmailAddress(), mailUtils.stripInvalidCharsFromName(accountVO.getIndividualName()));
      messageVO.setFromAddress(fromAddress.toString());

      messageVO.setReplyTo(accountVO.getReplyToAddress());


      String subject = (String)emailForm.get("subject");
View Full Code Here

Examples of javax.mail.internet.InternetAddress

  private ArrayList parseAddresses(String unparsedString)
  {
    ArrayList addressList = new ArrayList();
    try {
      unparsedString = unparsedString.replaceAll(";",",");
      InternetAddress tempAddress = new InternetAddress();
      InternetAddress[] rawAddresses =  InternetAddress.parse(unparsedString);
      for (int i=0; i<rawAddresses.length; i++) {
        addressList.add(rawAddresses[i].toString());
      }
    }catch(Exception e){
View Full Code Here

Examples of javax.mail.internet.InternetAddress

          // get the details of each account
          Iterator iter = accountIDList.iterator();
          while (iter.hasNext()) {
            Number accountID = (Number) iter.next();
            MailAccountVO accountVO = mailRemote.getMailAccountVO(accountID.intValue());
            InternetAddress address = new InternetAddress(accountVO.getEmailAddress(), accountVO.getAccountName());
            LabelValueBean accountDetails = new LabelValueBean(address.toString(), accountID.toString());
            accountList.add(accountDetails);
          }
        }
        dynaform.set("accountList", accountList);
      } // if (mergeType.equals("EMAIL"))
View Full Code Here

Examples of javax.mail.internet.InternetAddress

      MailAccountVO accountVO = remote.getMailAccountVO(accountID.intValue());
      if (accountVO == null) {
        accountVO = new MailAccountVO();
      }

      InternetAddress fromAddress = new InternetAddress(accountVO.getEmailAddress(), accountVO
          .getAccountName());
      messageVO.setFromAddress(fromAddress.toString());

      messageVO.setReplyTo(accountVO.getReplyToAddress());

      String subject = (String)emailForm.get("subject");
      messageVO.setSubject(subject);
View Full Code Here

Examples of javax.mail.internet.InternetAddress

      session.setAttribute("currentMailFolder", folderID);
      emailForm.set("private",(String)messageVO.getPrivate());
      String fromAddress = (String)messageVO.getFromAddress();
      if (fromAddress != null && !fromAddress.equals("") && CVUtility.isEmailAddressValid(fromAddress))
      {
        emailForm.set("from", new InternetAddress(fromAddress));
      }else{
    InternetAddress blankfromAddress = new InternetAddress();
    blankfromAddress.setAddress("");
        emailForm.set("from", blankfromAddress);
      }
     
      // the the To: list. Make sure it contains InternetAddress objects
      ArrayList toListVO = (ArrayList)messageVO.getToList();
View Full Code Here

Examples of javax.mail.internet.InternetAddress

     
      emailForm.set("private",(String)messageVO.getPrivate());
      String fromAddress = (String)messageVO.getFromAddress();
      if (fromAddress != null && CVUtility.isEmailAddressValid(fromAddress))
      {
        emailForm.set("from", new InternetAddress(fromAddress));
      }else{
    InternetAddress blankfromAddress = new InternetAddress();
    blankfromAddress.setAddress("");
        emailForm.set("from", blankfromAddress);
      }

      // the the To: list. Make sure it contains InternetAddress objects
      ArrayList toListVO = (ArrayList)messageVO.getToList();
View Full Code Here

Examples of javax.mail.internet.InternetAddress

        content.addBodyPart(bodyPart);

        if (from == null) {
            message.setFrom();
        } else {
            message.setFrom(new InternetAddress(from));
        }
        message.setRecipients(Message.RecipientType.TO, to);
        message.setRecipients(Message.RecipientType.CC, cc);
        message.setRecipients(Message.RecipientType.BCC, bcc);
        message.setSubject(mailMessage.getSubject());
View Full Code Here

Examples of javax.mail.internet.InternetAddress

        List/*InternetAddress*/ result = new ArrayList();
        for (int i = 0; i < addresses.length; i++) {
            String address = addresses[i];
            InternetAddress[] parsedAddresses = InternetAddress.parse(address);
            for (int j = 0; j < parsedAddresses.length; j++) {
                InternetAddress parsedAddress = parsedAddresses[j];
                result.add(parsedAddress);
            }
        }
        return (InternetAddress[]) result.toArray(new InternetAddress[result.size()]);
    }
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.