Package javax.mail.internet

Examples of javax.mail.internet.InternetAddress.validate()


                address.setPersonal(name, set.name());
            }

            // run sanity check on new InternetAddress object; if this fails
            // it will throw AddressException.
            address.validate();
        }
        catch (AddressException e)
        {
            throw new EmailException(e);
        }
View Full Code Here


   */
  public static void isEmailAddress(String email, String message)
  {
    try {
      InternetAddress emailAddr = new InternetAddress(email);
      emailAddr.validate();
    } catch (AddressException ex) {
      throw new IllegalArgumentException(message);
    }
  }

View Full Code Here

                }
            }

            // run sanity check on new InternetAddress object; if this fails
            // it will throw AddressException.
            address.validate();
        }
        catch (final AddressException e)
        {
            throw new EmailException(e);
        }
View Full Code Here

                    for (String m : emails) {
                        if (m != null && !"".equals(m)) {
                            try {
                                InternetAddress address = new InternetAddress(m);
                                address.validate();
                                email.addRecipient(Message.RecipientType.TO, address);
                            } catch (MessagingException e) {
                                logger.debug(e.getMessage(), e);
                            }
                        }
View Full Code Here

                    }
                    for (String m : emails) {
                        if (m != null && !"".equals(m)) {
                            try {
                                InternetAddress address = new InternetAddress(m);
                                address.validate();
                                email.addRecipient(Message.RecipientType.CC, address);
                            } catch (MessagingException e) {
                                logger.debug(e.getMessage(), e);
                            }
                        }
View Full Code Here

                    }
                    for (String m : emails) {
                        if (m != null && !"".equals(m)) {
                            try {
                                InternetAddress address = new InternetAddress(m);
                                address.validate();
                                email.addRecipient(Message.RecipientType.BCC, address);
                            } catch (MessagingException e) {
                                logger.debug(e.getMessage(), e);
                            }
                        }
View Full Code Here

          if(email == null || email.length() == 0)
            continue;
          try
          {
            InternetAddress address = new InternetAddress(email);
            address.validate();
            recipientsList.add(address);
          }catch(AddressException ae)
          {
            logger.warn("Email " + email + " is incorrect: " + ae.getMessage());
            if(badEmails != null)
View Full Code Here

      }
      else
      {
         address.setPersonal(personal, charset);
      }
      address.validate();
      return address;
   }

   @Override
   public void encodeChildren(FacesContext arg0) throws IOException
View Full Code Here

                }
            }

            // run sanity check on new InternetAddress object; if this fails
            // it will throw AddressException.
            address.validate();
        }
        catch (AddressException e)
        {
            throw new EmailException(e);
        }
View Full Code Here

          e);
    }
   
    // Validate the address.
    try {
      result.validate();
    }
    catch(AddressException e) {
      throw
      new OmhException(
        "The email address is not a valid email address.",
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.