Art.Email.Validator
npm install art-email-validatorValidate email and suggest corrections. Steps:
1. check the domain syntactically - just a rough, quick-check
1. look up the MX record for the domain, fail if it doesn't exist
1. communicate with the SMTP server on the MX-server to determine if the mailbox exists
1. if the SMTP server responds ambiguously, optionally, invoke fallbackValidator - useful to call an external, premium validation service
Always returns a results-object regardless of what happens, example output:
* valid: true/false
* invalid: true/false
* didYouMean: '...@...' (provided by mailcheck)
* message: 'details about what happened'
The most important results, valid and invalid will only be set to true if there is a strong confirmation that they are true. Therefor, they can can be true/false, false/true or false/false respectively, but never true/true. In the false/false case, the result is ambiguous. The email passed several tests, but didn't get a hard confirmation from the email server that the address exists.
> Note: additional fields may be returned with additional information about the validation for introspection and logging purposes.
``coffeescript`
npm install art-email-validator
`coffeescript
&ArtEmailValidator.validateEmail
email: "foobar@gmailcom" # email to check
smtpHost: "my.domain.com" # your domain, the same every call
.then (results) ->
$3
`coffeescript
&ArtEmailValidator.validateEmail options
.then (results) ->NOTE: &ArtEmailValidator means: require('art-email-validator')
`####
options