zytzagoo / smtp-validate-email

A PHP library for performing email addresses validation via SMTP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to read the result as valid or invalid.

Wmas opened this issue · comments

commented

75% of the tested email addresses (existing and correct, existing but incorrect) gives the same $smtp_results array (except the address of course).

I have tried to use the $smtp_results[$email] which in some cases when the email address is correct will be equal to 1:

Array
(
    [info@entrustrock.nl] => 1
    [domains] => Array
        (
            [entrustrock.nl] => Array
                (
                    [users] => Array
                        (
                            [0] => info
                        )

                    [mxs] => Array
                        (
                            [entrustrock.nl] => 0
                        )

                )

        )

)

But as described here above with some others correct addresses it will be empty and it will flag it as incorrect.

Can you please add in the read me file an example which will describe how we can use the returned array to detect if an email address is valid on invalid?

Regards

commented

+1

I'm having a hard time understanding the question...

If/when $smtp_results[$email] does not equal a truthy value, it means that email is considered invalid for whatever reason (there could be many reasons).

You can try setting public debug = true; within the class (https://github.com/zytzagoo/smtp-validate-email/blob/master/smtp-validate-email.php#L83) or just do $validator->debug = true; before calling validate().

That way you'll hopefully see exactly what happens and how/why an address ends up being marked as (in)valid.

Does that help?

commented

Thank you for your reply.

I will give it a try

Regards

Franco Magliozzi
franco@webline-studio.nl

On 12 Sep 2016, at 14:39, zytzagoo notifications@github.com wrote:

I'm having a hard time understanding the question...

If/when $smtp_results[$email] does not equal a truthy value, it means that email is considered invalid for whatever reason (there could be many reasons).

You can try setting public debug = true; within the class (https://github.com/zytzagoo/smtp-validate-email/blob/master/smtp-validate-email.php#L83) or just do $validator->debug = true; before calling validate().

That way you'll hopefully see exactly what happens and how/why an address ends up being marked as (in)valid.

Does that help?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.