Exemple #1
0
 function delivery($conn)
 {
     $ret = false;
     if (is_string($conn)) {
         $conn = trim($conn);
         if (FUNC::is_alpha($conn, false, '-')) {
             $exp = explode('-', $conn);
             $rep = array();
             foreach ($exp as $val) {
                 $val = strtolower($val);
                 if (isset($this->_arrcon[$val])) {
                     $rep[] = $val;
                 } else {
                     trigger_error('Invalid connection type value "' . $val . '", on class SMTP::delivery()', 512);
                 }
             }
             if (count($rep) > 0) {
                 $this->_smtpconn = $rep;
                 $ret = true;
             }
         } else {
             trigger_error('Invalid parameter value, on class SMTP::delivery()', 512);
         }
     } else {
         trigger_error('Invalid parameter type value, on class SMTP::delivery()', 512);
     }
     return $ret;
 }
Exemple #2
0
 function is_hostname($strhost)
 {
     $ret = false;
     if (is_string($strhost) && $strhost != "") {
         if (FUNC::is_alpha($strhost, true, "-.")) {
             $exphost1 = explode('.', $strhost);
             $exphost2 = explode('-', $strhost);
             if (count($exphost1) > 1 && !(strstr($strhost, '.-') || strstr($strhost, '-.'))) {
                 $set1 = $set2 = true;
                 foreach ($exphost1 as $expstr1) {
                     if ($expstr1 == "") {
                         $set1 = false;
                         break;
                     }
                 }
                 foreach ($exphost2 as $expstr2) {
                     if ($expstr2 == "") {
                         $set2 = false;
                         break;
                     }
                 }
                 $ext = $exphost1[count($exphost1) - 1];
                 $len = strlen($ext);
                 if ($set1 && $set2 && $len > 1 && $len < 7 && FUNC::is_alpha($ext, false)) {
                     $ret = true;
                 }
             }
         }
     }
     return $ret;
 }