CF_Email_Validator is a quick solution to check email address. By using this tag, you can be sure that some server will actually receive the email for further delivery.
The tag supports 3 methods of email checking: 1. Email address format checking 2. MX lookup. This method will check the existence of SMTP server responsible of delivering the email to designated address. 3. SMTPCheck. This method will ask the SMTP whether specific address really exists, without actually delivering email.
Note: The original Java source code for this tag is not distributed and it's not intended for sale. Contact us if you want to customize this custom tag further.
Requirements
Supported ColdFusion Server:
- ColdFusion MX 6, 6.1
- ColdFusion MX 7
on all operating systems.
Note: If you're using this tag behind CF security sandbox, make sure the sandbox allows creating socket connection to outside network on port 25(SMTP) and 53(DNS)
We encourage downloading the evaluation version first, install and test it in your environment. Click here to download the free evaluation version
Usage
| <cf_Email_Validator |
address="email address to check, mandatory" |
| |
method="format|mxlookup|smtpcheck, mandatory" |
| |
mxtimeout="mx lookup timeout (milliseconds, default is 30000)" |
| |
mxretries="mx retries (how many retries, default is 4)" |
| |
smtptimeout="smtp timeout (milliseconds, default is 30000)" |
| |
dns="dns server address" |
| |
helo="helo string" |
| |
from="from address, usually your email address" |
| |
result="result variable, mandatory"> |
Note: If you're using this tag behind CF security sandbox, make sure the sandbox allows creating socket connection to outside network on port 25(SMTP) and 53(DNS)
Explanation: 1. Method must be one of this: format, mxlookup or smtpcheck 2. DNS if omitted will use operating system default DNS 3. Result variable is a comma delimited list containing result and description. Possible results are: - True, description - False, failed description - Error: error description You have to check the first list item, and if you want to, you can see the description in the last list item. For example: <cfif listfirst(Result) is "true"> <!--- email is valid according to selected checking method ---> <cfelseif listfirst(Result) is "false"> <!--- email is not valid according to selected checking method ---> <cfelse> <!--- Error thrown, possibly invalid email or network error ---> </cfif>
|