Socket
Socket
Sign inDemoInstall

quickemailverification

Package Overview
Dependencies
47
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

25

lib/quick_email_verification/api/quickemailverification.js

@@ -35,3 +35,28 @@ /**

/**
* Return predefined response for predefined email address
*
* '/verify/sandbox?email=:email' GET
*
* @param "email" send email address in query parameter
*/
Quickemailverification.prototype.sandbox = function (email, options, callback) {
if (typeof options == 'function') {
callback = options;
options = {};
}
email = encodeURIComponent(email);
var body = (options['query'] ? options['query'] : {});
this.client.get('/verify/sandbox?email=' + email + '', body, options, function(err, response) {
if (err) {
return callback(err);
}
callback(null, response);
});
};
// Export module
module.exports = Quickemailverification

28

lib/quick_email_verification/http_client/error_handler.js

@@ -20,16 +20,20 @@ var errors = require('../error');

// If JSON, a particular field is taken and used
if (type.indexOf('json') != -1 && typeof body == 'object') {
if (body['error']) {
message = body['error'];
} else {
message = 'Unable to select error message from json returned by request responsible for error';
}
}
var arrErrCode = new Array(400, 401, 402, 403, 404, 429);
if(arrErrCode.indexOf(code) == -1)
{
// If JSON, a particular field is taken and used
if (type.indexOf('json') != -1 && typeof body == 'object') {
if (body['error']) {
message = body['error'];
} else {
message = 'Unable to select error message from json returned by request responsible for error';
}
}
if (message == '') {
message = 'Unable to understand the content type of response returned by request responsible for error';
if (message == '') {
message = 'Unable to understand the content type of response returned by request responsible for error';
}
return callback(new errors.ClientError(message, code));
}
return callback(new errors.ClientError(message, code));
}

@@ -36,0 +40,0 @@

@@ -34,3 +34,3 @@ var url = require('url')

'api_version': 'v1',
'user_agent': 'alpaca/0.2.1 (https://github.com/pksunkara/alpaca)'
'user-agent' : 'quickemailverification-node/v1.0.1 (https://github.com/quickemailverification/quickemailverification-node)'
};

@@ -37,0 +37,0 @@

{
"name": "quickemailverification",
"version": "1.0.0",
"version": "1.0.1",
"description": "Official QuickEmailVerification API library client for node.js",
"author": "quickemailverification <> (http://quickemailverification.com)",
"homepage": "http://quickemailverification.com",
"keywords": ["quickemailverification", "email verification api", "client", "library", "free", "email", "verify", "validation", "verification","api"],
"author": "quickemailverification <support@quickemailverification.com> (https://quickemailverification.com)",
"homepage": "https://quickemailverification.com",
"keywords": [
"quickemailverification",
"email verification api",
"client",
"library",
"free",
"email",
"verify",
"validation",
"verification",
"api",
"sandbox api"
],
"repository": {

@@ -9,0 +21,0 @@ "type": "git",

<p align="center">
<img src="http://quickemailverification.com/extra/images/logo_github.png" alt="Quick Email Verification">
<img src="https://quickemailverification.com/extra/images/logo_github.png" alt="Quick Email Verification">
<br>
</p>
# Official Email Validation API library client for Node.js

@@ -17,3 +16,3 @@

To begin, signUp at [quickemailverification.com](http://quickemailverification.com) and create a FREE account. After signup logged in, click on **[API Settings](http://quickemailverification.com/apisettings)** and then click **Add API Key**. To use API you need 2 parameters.
To begin, signUp at [quickemailverification.com](https://quickemailverification.com) and create a FREE account. After signup logged in, click on **[API Settings](https://quickemailverification.com/apisettings)** and then click **Add API Key**. To use API you need 2 parameters.

@@ -42,3 +41,8 @@ email - (string) This is a email address you need to verify. It should be url encoded.

// PRODUCTION MODE
quickemailverification.verify("test@example.com", function (err, response) {
// SANDBOX MODE
//quickemailverification.sandbox("valid@example.com", function (err, response) {
// Print response object

@@ -54,3 +58,3 @@ console.log(response.body);

- **result** `string` - The verified results will be: `valid`, `invalid`, `unknown`
- **reason** `string` - Reason definations are as below:
- **reason** `string` - Reason definitions are as below:
- `invalid_email` - Specified email has invalid email address syntax

@@ -61,3 +65,3 @@ - `invalid_domain` - Domain name does not exist

- `no_connect` - SMTP server connection failure
- `timeout` - Session time out occured at SMTP server
- `timeout` - Session time out occurred at SMTP server
- `unavailable_smtp` - SMTP server is not available to process request

@@ -69,10 +73,15 @@ - `unexpected_error` - An unexpected error has occurred

- **disposable** `true | false` - *true* if the email address uses a *disposable* domain
- **accept_all** `true | false` - *true* if the domain appears to *accept all* emails delivered to that domain
- **role** `true | false` - *true* if the email address is a *role* address (`manager@example.com`, `ceo@example.com`, etc)
- **free** `true | false` - *true* if the email address is from free email provider like Gmail, Yahoo!, Hotmail etc.
- **email** `string` - Returns a normalized version. (`Niki@example.com` -> `niki@example.com`
- **user** `string` - The local part of an email address. (`niki@example.com` -> `niki`)
- **domain** `string` - The domain of the provided email address. (`niki@example.com` -> `example.com`)
- **mx_record** `string` - The preferred MX record of email domain. This field contains empty string when MX record is not available.
- **mx_domain** `string` - The domain name of the MX host. This field contains empty string when MX record is not available.
- **safe_to_send** `true | false` - *true* if the email address is safe for deliverability
- **did_you_mean** `string` - Returns email suggestions if specific typo errors found in email
- **success** `true | false` - *true* if the API request was successful
- **message** `string` - Describes API call failure reason
- **disposable** `true | false` - *true* if the email address uses a *disposable* domain.
- **accept_all** `true | false` - *true* if the domain appears to accept all emails delivered to that domain

@@ -96,2 +105,7 @@ ### HTTP Response headers

## Sandbox Mode
QuickEmailVerification single email verification API sandbox mode helps developers to test their integration against simulated results. Requesting against sandbox endpoint is totally free and no credits will be deducted from actual credit quota.
Please refer our [knowledge base](http://docs.quickemailverification.com/email-verification-api/sandbox-mode) to learn more about sandbox mode.
## License

@@ -104,2 +118,2 @@ MIT

## Need Help? Feel free to contact us
http://quickemailverification.com/contact-us
https://quickemailverification.com/contact-us
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc