NSlookup is good if you only need to know the server.  CFX_ValidEmail also
checks if the use exists.  I use it to avoid duff mail addresses producing
spam triggers, it can save a user needing a registration confirmation email
- which can cause spam triggers themselves.

-----Original Message-----
From: Claude Schnéegans <schneeg...@internetique.com>
[mailto:=?ISO-8859-1?Q?Claude_Schn=E9egans <schneegans@interneti=71?=
=?ISO-8859-1?Q?ue.com=3E?=] 
Sent: 10 October 2013 21:38
To: cf-talk
Subject: Re: Check an email domain


 >>You need to use nslookup

Yes, this is what I end up doing.
Here is a function that returns the name of the mail server id there is on,
or an empty string if there is not.
(tested on Windows)


<CFFUNCTION NAME="nslookup">
   <CFARGUMENT NAME="domain" REQUIRED="yes" TYPE="string">
   <CFEXECUTE name="c:\windows\system32\nslookup.exe"
   arguments=" -type=mx #domain#"
   variable="this.nslookup"
   timeout="10" />
   <CFSET n = findNoCase ("mail exchanger = ", this.nslookup)>
   <CFIF n EQ 0>
     <CFRETURN "">
   <CFELSE>
     <CFRETURN mid (this.nslookup, n+17, 9999)>
   </CFIF>
</CFFUNCTION>

<CFOUTPUT>houseoffusion.com = #nslookup("houseoffusion.com")#<BR>
homeoffusion.com = #nslookup("homeoffusion.com")# </CFOUTPUT>





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356910
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to