CodeIgniter Forums
Use my class - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Use my class (/showthread.php?tid=88034)



Use my class - csanesz - 07-10-2023

Hi,
I have a class file, APPPATH.'ThirdParty/EmailValidation/EmailValidation.php' this file is found:
https://github.com/nsgeorgi/verify-email/blob/master/class.verifyEmail.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?


RE: Use my class - kenjis - 07-10-2023

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


RE: Use my class - brabus - 07-13-2023

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...