The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mslm::EmailVerify - Perl module for email verification using an API

SYNOPSIS

  use Mslm::EmailVerify;

  my $email_verifier = Mslm::EmailVerify->new($api_key);

  # Single email verification
  my $verification_result = $email_verifier->single_verify('example@example.com');

  # Set base URL
  $email_verifier->set_base_url('https://example.com');

DESCRIPTION

The Mslm::EmailVerify module provides methods to perform email verification using an API.

METHODS

new

Creates a new instance of Mslm::EmailVerify.

Arguments

  • $api_key (string) - The API key required for authentication.

  • %opts (hash) - Optional parameters. You can pass in the following opts: base_url, user_agent, api_key, and http_client. These settings can also be done via the setter functions named: set_base_url, set_user_agent, set_api_key, set_http_client.

error_msg

Returns a string containing the error message of the last operation, it returns an empty string if the last operation was successful

single_verify

Verifies a single email address.

Arguments

  • $email (string) - The email address to be verified.

  • %opts (hash) - Optional parameters. You can pass in the following opts: base_url, user_agent, api_key, http_client, and disable_url_encoding. These options will only work for the current request.

set_base_url

Sets the base URL for API requests.

Arguments

  • $base_url_str (string) - The base URL to be set for API requests.

set_http_client

Sets the HTTP client for making requests.

Arguments

  • $http_client (LWP::UserAgent) - The HTTP client to be set.

set_user_agent

Sets the user agent for API requests.

Arguments

  • $user_agent (string) - The user agent string to be set.

set_api_key

Sets the API key for authentication.

Arguments

  • $api_key (string) - The API key to be set.

AUTHOR

Mslm, <usama.liaqat@mslm.io>

COPYRIGHT AND LICENSE

Copyright (c) 2022-now mslm. All rights reserved.