since ‎26-02-2013
‎10-12-2019
ahli008
Level 1
Reference com.day.commons.simplejndi.impl.ContextService in component ahli008 - Adobe Experience Manager
Hi,I am implementing a component which can validate email address.For using MX record to validate email, I need to use jndi as below:int doLookup( String hostName ) throws NamingException { Hashtable env = new Hashtable(); env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory"); DirContext ictx = new InitialDirContext( env ); Attributes attrs = ictx.getAttributes( hostName, new String[] { "MX" }); Attribute attr = attrs.get( "MX" ); if( attr == null ) return( 0 ); return( at...
663
Views
0
Likes
2
Answers and Comments