How reliable is this check? I was expecting not to get anything in case of faulty domain, but I do, and I get as well the same answer in case of normal nslookup from the command line, and is there is any more strict script which can verify the email server?
P.S. I running this check from another email server.

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite. Learn more about what this means for you and how you can improve your security with WatchGuard today!

@chanderpal: I think the author was looking for a way to see if an email address was valid:

I want to write a script which verifies the email address...

PHPMailer is a useful tool, but it's not really responsive to the question of email verification.

0

Ashraf HassaneinAuthor Commented: 2013-12-24

@chanderpal thanks for your help but I needed indeed a script to validate the email
@ray, thanks the scripts working pretty fine, but again to the same discussion for all my questions :-) how to integrate this check in my jquery validate, I have found something in this link:http://www.jquery4u.com/ajax/jquery-ajax-validation-remote-rule/

And I have modified the rules section to be something like that:
var validator = $("#createuser").validate({
rules: {
username: {
required: true,
minlength: 6,
remote: "useravailable_check.php"
},
extemail: {
required: true,
email: true,
remote: {
url: "extemail_check.php",
type: "get",
data: { e: function()
{
var extemail = $('#extemail').val();
extemail = extemail.replace(/^\s+|\s+$/,'');
return extemail
}
}
}
},
},
And the messages to:
},
messages: {
username: {
required: "Enter a username",
minlength: jQuery.format("Enter at least {0} characters"),
remote: jQuery.format("{0} is already in use")
},
extemail: {
required: "Please enter a valid email address",
minlength: "Please enter a valid email address",
remote: jQuery.validator.format("{0} does not have a valid domain")
},
},
so it kept complaining about the replace is used with undefined
So I changed it to:
data: { e: function()
{
return $("#extemail").val();
}
}
}
Now it does not complain from the replace but it does not do anthing else :-)
Sorry for keep jumping from one question to anothor but I believe that this problem now is the same as the one I have with mockjax I want just to an remote script for the check.

0

Ashraf HassaneinAuthor Commented: 2013-12-24

Ok I have found a stupid mistake in the changes I did for the PHP I forgot the quotes in the echo :-)
so I have changed it to :
if (check_valid_email($e))
{
echo "true" ;
}
else
{
echo "false" ;
}

So it is working now, but with no replace to remove any empty spaces in the value, any clue why?