michaelsmithgit / php-smtp-email-validation

Automatically exported from code.google.com/p/php-smtp-email-validation
0 stars 0 forks source link

Wrong report #23

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
$email = 'siakjfafdahfdhssgfgfkfsfsj@gmail.com';
$SMTP_Validator = new SMTP_validateEmail();
$SMTP_Validator->debug = true;
$results = $SMTP_Validator->validate(array($email));
echo $email.' is '.(isset($results[$email]) ? 'valid' : 'invalid')."\n";

What is the expected output? What do you see instead?
Expected:
siakjfafdahfdhssgfgfkfsfsj@gmail.com is invalid

Effective:
Array
(
    [gmail-smtp-in.l.google.com] => 5
    [alt1.gmail-smtp-in.l.google.com] => 10
    [alt2.gmail-smtp-in.l.google.com] => 20
    [alt3.gmail-smtp-in.l.google.com] => 30
    [alt4.gmail-smtp-in.l.google.com] => 40
    [gmail.com] => 0
)
try gmail-smtp-in.l.google.com:25
<<<
220 mx.google.com ESMTP n7si24377456wiy.46
>>>
HELO localhost
<<<
250 mx.google.com at your service
>>>
MAIL FROM: <user@localhost>
<<<
250 2.1.0 OK n7si24377456wiy.46
>>>
RCPT TO: <siakjfafdahfdhssgfgfkfsfsj@gmail.com>
<<<
550-5.1.1 The email account that you tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1 http://support.google.com/mail/bin/answer.py?answer=6596 
n7si24377456wiy.46
>>>
RSET
<<<
250 2.1.5 Flushed n7si24377456wiy.46
>>>
quit
<<<
221 2.0.0 closing connection n7si24377456wiy.46
siakjfafdahfdhssgfgfkfsfsj@gmail.com is valid

What version of the product are you using? On what operating system?
PHP 5.4.4.0
php-smtp-email-validation: Alpha1

Thanks for your work!

Original issue reported on code.google.com by Fabiogio...@gmail.com on 14 Aug 2012 at 9:00

GoogleCodeExporter commented 8 years ago
Ok, I understood what the error was, sorry for reporting a wrong issue, still 
it prints unexpected results if the host is wrong, example:

$email = 'siakjfafdahfdhssgfgfkfsfsj@gadsasddsamail.com';
$SMTP_Validator = new SMTP_validateEmail();
$SMTP_Validator->debug = true;
$results = $SMTP_Validator->validate(array($email));
echo $email.' is '.($results[$email] ? 'valid' : 'invalid')."\n";

prints

Array
(
    [gadsasddsamail.com] => 0
)
try gadsasddsamail.com:25

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Host 
sconosciuto. in C:\server\htdocs\res\validateEmail.php on line 154

Warning: fsockopen(): unable to connect to gadsasddsamail.com:25 
(php_network_getaddresses: getaddrinfo failed: Host sconosciuto. ) in 
C:\server\htdocs\res\validateEmail.php on line 154

Notice: Undefined index: siakjfafdahfdhssgfgfkfsfsj@gadsasddsamail.com in 
C:\server\htdocs\mailtest.php on line 8
siakjfafdahfdhssgfgfkfsfsj@gadsasddsamail.com is invalid

Original comment by Fabiogio...@gmail.com on 14 Aug 2012 at 9:09