Welcome Guest, Not a member yet? Register   Sign In
Use my class
#1

Hi,
I have a class file, APPPATH.'ThirdParty/EmailValidation/EmailValidation.php' this file is found:
https://github.com/nsgeorgi/verify-email...yEmail.php
In simple PHP examle this file using:
PHP Code:
include_once 'class.verifyEmail.php';

        $email '[email protected]';

        $vmail = new verifyEmail();

        if ($vmail->check($email)) {
            echo 'email <' $email '> exist!';
        } elseif ($vmail->isValid($email)) {
            echo 'email <' $email '> valid, but not exist!';
        } else {
            echo 'email <' $email '> not valid and not exist!';
        


How to use this EmailValidation class, in my controllers?
Reply
#2

The example seems to work in your controllers.
Something wrong?
Reply
#3

(This post was last modified: 07-13-2023, 05:21 AM by brabus.)

app/Core.php


PHP Code:
<?php

namespace App\Controllers;

use 
App\ThirdParty\EmailValidation\EmailValidation;

class 
Core extends BaseController
{
    public function init()
    {
        $em = new EmailValidation();
        $res $em->check('[email protected]');
        dd($res);
    }



app/ThirdParty/EmailValidation/EmailValidation.php


PHP Code:
<?php

namespace App\ThirdParty\EmailValidation;

/**
* Class to check up e-mail
*
* @author Konstantin Granin <[email protected]>
* @copyright Copyright (c) 2010, Konstantin Granin
*/
class EmailValidation
{
    /**
    * User name
    * @var string
    */
    private $_fromName;

    /**
    * Domain name
    * @var string
    */
    private $_fromDomain


class body from github...
Reply




Theme © iAndrew 2016 - Forum software by © MyBB