hi everyone i checked this script version of php5.3. lower version of php may not support this script but you check it.
CHERAN@EXAMPLE.COM
CHERAN(USERNAME);
EXAMPLE.COM(DOMAIN NAME)
E-mail addresses, such as cheran@example.com, have two parts. The part before the @ sign is the local-part of the address, often the username of the recipient (cheran), and the part after the @ sign is the domain which is a hostname to which the e-mail message will be sent (example.com).
THE CODE:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method='post'>
<table border='0'>
<tr>
<td>Email</td>
<td><input name='email' type='text' value="<?php if(isset($_REQUEST['email'])){ echo $_REQUEST['email']; } else { } ?>" id='email' /></td>
</tr>
<tr>
<td> </td>
<td><input type='submit' name='Submit' value='Validate' /></td>
</tr>
</table>
</form>
<?php
if(isset($_POST['email'])) {
//check with out function
$email = $_POST['email'];
print("Checking: $email<br>");
if (preg_match ("/^[\w\.-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]+$/", $email)) {
print("Format Test: PASSED<br>");
print("Online host verification Test...<br><br>");
print("MX Records for: $email<br>");
list($alias, $domain) = explode("@", $email);
if (checkdnsrr($domain, "MX")) {
getmxrr($domain, $mxhosts);
foreach($mxhosts as $mxKey => $mxValue){
print(" $mxValue<br>");
}
print("Online host verification Test: PASSED<br><br>");
print("Email Status: VALID");
} else {
print(" No records found.<br>");
print("Online host verification Test: FAILED<br><br>");
print("Email Status: INVALID");
}
} else {
print("Format Test: FAILED<br><br>");
print("Invalid email address provided.<br><br>");
print("Email Status: INVALID");
}
}
?>
SCREEN SHOT
click the image to enlarge
