<?php
        function IsValidEmailMX($strEmail)
        {
                // Split email address
                list($strUsername, $strDomain) = split("@", $strEmail);
       
                // Validate the domain
                if (getmxrr($strDomain, $aMXRecords))
                {
                        return true;
                }
       
                return false;
        }
?>