NAME

Net::Mailboxlayer::Response - Encapsulates a response from mailboxlayer.com's REST API.

SYNOPSIS

 use Net::Mailboxlayer;

 my $mailboxlayer = Net::Mailboxlayer->new(access_key => 'YOUR_ACCESS_KEY', email_address => 'support@apilayer.com');
 my $result = $mailboxlayer->check;

 if (not $result->has_error)
 {
   # $result is a F<Net::Mailboxlayer::Response> object.
   print $result->score . "\n";
 }

DESCRIPTION

You would not normally be calling this module directly, it is one of the possible return objects from a call to Net::Mailboxlayer's check method.

new

Returns a new Net::Mailboxlayer::Response object.

has_error

This is a convenience method that allows you to determine if the result object had an error or not. For this module if will always be 0 (false).

email

Contains the exact email address requested

 print $result->email; # support@apilayer.com

did_you_mean

Contains a did-you-mean suggestion in case a potential typo has been detected.

 print $result->did_you_mean; # ""

user

Returns the local part of the request email address. (e.g. "paul" in "paul@company.com")

 print $result->user; # support

domain

Returns the domain of the requested email address. (e.g. "company.com" in "paul@company.com")

 print $result->domain; # apilayer.net

format_valid

Returns true or false depending on whether or not the general syntax of the requested email address is valid.

 print $result->format_valid; # 1

mx_found

Returns true or false depending on whether or not MX-Records for the requested domain could be found.

 print $result->mx_found; # 1

smtp_check

Returns true or false depending on whether or not the SMTP check of the requested email address succeeded.

 print $result->smtp_check; # 1

catch_all

Returns true or false depending on whether or not the requested email address is found to be part of a catch-all mailbox.

 print $result->catch_all; # undef

Note that as of 2016-08-12 this will always be undef for free accounts.

role

Returns true or false depending on whether or not the requested email address is a role email address. (e.g. "support@company.com", "postmaster@company.com")

 print $result->role; # 1

disposable

Returns true or false depending on whether or not the requested email address is a disposable email address. (e.g. "user123@mailinator.com")

 print $result->disposable; # 0

free

Returns true or false depending on whether or not the requested email address is a free email address. (e.g. "user123@gmail.com", "user123@yahoo.com")

 print $result->free; # 0

score

Returns a numeric score between 0 and 1 reflecting the quality and deliverability of the requested email address.

 print $result->score; # 0.8

response

Provides access to the return value of $user_agent->get(). You would not normally need to access this.

 print $result->response->decoded_content; # prints the JSON return from the api call.

AUTHOR

Tom Heady <cpan@punch.net>

COPYRIGHT & LICENSE

Copyright 2016 Tom Heady.

This program is free software; you can redistribute it and/or modify it under the terms of either:

  • the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or

  • the Artistic License.