NoDNSMXRecord example

// No MX, A or AAAA DNS records         if ($dnsRecords === []) {
            $this->error = new InvalidEmail(new ReasonNoDNSRecord(), '');
            return false;
        }

        // For each DNS record         foreach ($dnsRecords as $dnsRecord) {
            if (!$this->validateMXRecord($dnsRecord)) {
                // No MX records (fallback to A or AAAA records)                 if (empty($this->mxRecords)) {
                    $this->warnings[NoDNSMXRecord::CODE] = new NoDNSMXRecord();
                }
                return false;
            }
        }
        return true;
    }

    /** * Validate an MX record * * @param array $dnsRecord Given DNS record. * * @return bool True if valid. */
Home | Imprint | This part of the site doesn't use cookies.