Is there any possible way to find out if an email address exists in c#?
e.g. I have an email address like abcded@yahoo.com or asdf234@hotmail.com How can I do the validation?
Is there any possible way to find out if an email address exists in c#?
e.g. I have an email address like abcded@yahoo.com or asdf234@hotmail.com How can I do the validation?
Once upon a time the Internet and the SMTP mail transfer protocol was invented. It was back in the good old days when everyone were nice and friendly, so a command was included in the SMTP protocol to verify email addresses - the VRFY command.
However, darkness came upon the Internet and brought spammers, worms and other evil, so the sysadmins of the Internet mail servers defended what was good by disabling the VRFY command.
So the short answer is: No.
The most obvious way is to send an email to the mail address and ask the recipient to reply or click a link.
Basicly: you can't. There are servers that support finger (to verify that a particular user exists), but for Hotmail/Gmail it's just not possible. The mail will bounce though.
In general that's not possible. Which is why many websites have that to sign up you have to give your email address and they'll send a link where you have to go to that link to confirm that it's your email.
No way at all
If it's for a reason, such as signing up with verification, then someone will reply when you send.
Why do you want to do this?
I'm a little bit late, but this might help someone Now you can check if the email exists or not.
Here is the code that I'm currently using on my website. You can use the same API in c#
if(isEmialExist("EMAIL_ADDRESS_THAT"))
{
echo "email exists, real email";
}
else
{
echo "email doesn't exist";
}
function isEmialExist($emailAddress)
{
if (!filter_var($emailAddress, FILTER_VALIDATE_EMAIL)) {
return false; //invalid format
}
//now check if email really exist
$postdata = http_build_query(array('api_key' => 'YOUR_API_KEY', 'email' => $emailAddress ));
$url = "https://email-validator.com/api/v1.0/json";
$opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-Type: application/x-www-form-urlencoded', 'content' => $postdata ));
$context = stream_context_create($opts);
$result = file_get_contents($url, false, $context);
$data = json_decode($result, false);
return $data->is_exists;
}
You can find more details here. https://email-validator.com/tutorial