Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it L'avatar di drew
    Registrato dal
    Oct 2009
    Messaggi
    11

    Verificare esistenza mail con php

    Qualcuno sa dirmi come verificare l'esistenza di un indirizzo mail tramite php?
    Grazie mille.
    ~Drew~

  2. #2

  3. #3
    Utente di HTML.it L'avatar di drew
    Registrato dal
    Oct 2009
    Messaggi
    11
    Cosa devo ricercare in paricolare, ci sono molti script per email?
    ~Drew~

  4. #4

  5. #5
    Utente di HTML.it L'avatar di drew
    Registrato dal
    Oct 2009
    Messaggi
    11
    Grazie di tutto.
    ~Drew~

  6. #6
    Utente di HTML.it L'avatar di drew
    Registrato dal
    Oct 2009
    Messaggi
    11
    Scusa se ti disturbo ancora, ma ho avuto un problemino.
    Quasta è la classe che ho scelto:
    define ('DEBUG_OK', false);
    class CCheckMail
    {
    var $timeout = 10;
    var $domain_rules = array ("aol.com", "bigfoot.com", "brain.net.pk", "breathemail.net",
    "compuserve.com", "dialnet.co.uk", "glocksoft.com", "home.com",
    "msn.com", "rocketmail.com", "uu.net", "yahoo.com", "yahoo.de");

    function _is_valid_email ($email = "")
    { return preg_match('/^[.\w-]+@([\w-]+\.)+[a-zA-Z]{2,6}$/', $email); }

    function _check_domain_rules ($domain = "")
    { return in_array (strtolower ($domain), $this->domain_rules); }

    function execute ($email = "")
    {
    if (!$this->_is_valid_email ($email))
    { return false; }

    $host = substr (strstr ($email, '@'), 1);

    if ($this->_check_domain_rules ($host))
    { return false; }

    $host .= ".";

    if (getmxrr ($host, $mxhosts[0], $mxhosts[1]) == true)
    { array_multisort ($mxhosts[1], $mxhosts[0]); }
    else
    {
    $mxhosts[0] = $host;
    $mxhosts[1] = 10;
    }
    if (DEBUG_OK) { print_r ($mxhosts); }

    $port = 25;
    $localhost = $_SERVER['HTTP_HOST'];
    $sender = 'info@' . $localhost;

    $result = false;
    $id = 0;
    while (!$result && $id < count ($mxhosts[0]))
    {
    if (function_exists ("fsockopen"))
    {
    if (DEBUG_OK) { print_r ($id . " " . $mxhosts[0][$id]); }

    if ($connection = fsockopen ($mxhosts[0][$id], $port, $errno, $error, $this->timeout))
    {
    fputs ($connection,"HELO $localhost\r\n");
    $data = fgets ($connection,1024);
    $response = substr ($data,0,1);

    if (DEBUG_OK) { print_r ($data); }

    if ($response == '2')
    {
    fputs ($connection,"MAIL FROM:<$sender>\r\n");
    $data = fgets($connection,1024);
    $response = substr ($data,0,1);
    if (DEBUG_OK) { print_r ($data); }

    if ($response == '2')
    {
    fputs ($connection,"RCPT TO:<$email>\r\n");
    $data = fgets($connection,1024);
    $response = substr ($data,0,1);
    if (DEBUG_OK) { print_r ($data); }

    if ($response == '2')
    {
    fputs ($connection,"data\r\n");
    $data = fgets($connection,1024);
    $response = substr ($data,0,1);
    if (DEBUG_OK) { print_r ($data); }

    if ($response == '2')
    { $result = true; }
    }
    }
    }

    fputs ($connection,"QUIT\r\n");
    fclose ($connection);
    if ($result) { return true; }
    }
    }
    else
    { break; }
    $id++;
    }
    return false;
    }
    }
    Siccome nessuna mail risulta valida, ho provato a "stampare" alcune variabili. Stampando $data, il risultato è che non è supporato il metodo HELO. Saresti in grado di aiutarmi?
    Grazie.
    ~Drew~

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.