Skip to content Skip to sidebar Skip to footer

Verify If An Email Address Exists Or Not

I successfully done validation of mail address but I want some suggestions for verifying an email address. The main point is when user enter an email id it should b checked that it

Solution 1:

No, this facility is not available. You can verify only when you have your own mail server the you are authorized to check the mail id is valid or not. Or when you own other server then you are permitted to get the mirror image of all others mail server only then you can verify, So if you are just a user of mail id then you can verify that the mail id is valid or not.

You can only verify the correct format of mail id by pattern checking.

Have fun

Solution 2:

You can only check whether entered E-mail id is validate or not using regular expression, its not possible to check whether id is exists or not? as per my knowledge.

check out this link its already well answered

Solution 3:

publicstaticvoidmain(String[] args)throws Exception {
 Stringemail=null;
 Stringdns=null;

 BufferedReaderreader=newBufferedReader(newInputStreamReader(System.in));
System.out.print("Enter email address to validate: ");
email = reader.readLine();
System.out.print("Enter DNS hostname to perform domain validation (e.g. ns.myhost.com): ");
dns = reader.readLine();
// create EmailInspector instanceEmailInspectorinspector=newEmailInspector();

// enable debugging
inspector.setDebug(true);

// set DNS server
inspector.setNameserver(dns);

// set validation level
inspector.setEmailInspectionLevel(inspector.DOMAIN_VALIDATION);

// validate email
inspector.validate(email);
}

}






 .  Create newEmailInspector instance.
    .  Enable debugging.
    .  Set DNS server to be used for looking up domains.
    .  Set validation level.
    .  Validate email address.

Solution 4:

Propertiesprops= System.getProperties();

    props.put("mail.smtp.user", senderEmail);
    props.put("mail.smtp.host", "smtp.gmail.com");
    props.put("mail.smtp.port", "465");
    props.put("mail.smtp.starttls.enable", "true");
    props.put("mail.smtp.debug", "true");
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.socketFactory.port", "465");
    props.put("mail.smtp.socketFactory.class", 
          "javax.net.ssl.SSLSocketFactory");
    props.put("mail.smtp.socketFactory.fallback", "false");

    // Required to avoid security exception.
    email.MyAuthenticatorauthentication=newemail.MyAuthenticator(senderEmail,senderMailPassword);
    Sessionsession= 
          Session.getDefaultInstance(props,authentication);
    session.setDebug(true);

Post a Comment for "Verify If An Email Address Exists Or Not"