Email validate ( not only regex) - c#

I want to validate complete Email address.
I am not asking to match using pericular string.
but suppose someone enter email id a#bnm.com then first the bnm should be validated and if such domain found then also it should check for such a#bnm.com is available or invalid.???
Can anyone tell me how can i do this?>?>

Validating an email address and verifying the account actually exists are two very different things.
One way (and possibly the only effective way) to do this is at the end of the user registration process, send a 'reply required to confirm' email to the supplied email address (after checking the format is correct).
As Greg Hewgill noted, you should expire registrations that do not receive a reply in a certain time period, say 7 days.

Or you could use some Email validation service for verifing if they exists. I have found one for you Best Coding Pratices, well this is a free service and has some limitations on it.
If you dont like it you can google for other email validation services.

Related

DotNetOpenAuth I need some help please

I know this has been posted before, but never really answered, I'm using the DotNetOpenAuth to try and do GoogleID login, and every time I do details = OResponse.GetExtension<ClaimsResponse>(); I always, always, always get back null, I don't get whats the point of the GoogleID if I can't get back any information, I would think at the very least I would get an email address, so I could associate it other login information in my databse. I just don't understand could really use some help, Im probably just looking at openID in the wrong way.
I'm using ASP.NET and looking to use openID/Facebook as my sole means of logging in users, I really don't want to mess with membership roles, or extra junk that ASP.NET likes to add.
Yes, this has been asked and answered many times. Google does support AX. But it ignores any attributes marked as "optional". So if you want the email address, you have to say that email address is a required attribute.
The ClaimsResponse extension you're checking for isn't AX -- it's Simple Registration. But if you have AXFetchAsSregTransform behavior turned on (highly recommended) then it allows you to just use ClaimsRequest and ClaimsResponse exclusively, and DotNetOpenAuth will automatically translate to and from AX behind-the-scenes for you.
Alternatively, you can use FetchReqest and FetchResponse to speak AX directly to Google.
But (and I can't hammer this hard enough), do not use the email address as the user's unique identifier!!! Instead, use the IAuthenticationResponse.ClaimedIdentifier string as the unique identifier. Email address should generally be considered just a helpful hint that can be used to prefill a registration form. You shouldn't even trust that the email address you get is really under the user's control (that's one reason why it shouldn't be considered their unique id) since the Provider can lie to you. Google and Yahoo are two providers that promise (if you choose to trust them) that the email addresses have been verified, so you can skip the email validation step for users from them if you wish.
It doesn't appear that Google's OpenID server supports AX or sreg.

Retrieve E-mail from server (pop3) by date for filtering on subject or body in C#

I have a piece of monitoring software I am writing which needs to retrieve e-mails sent to an address for a certain day so that I can filter them by a regex in the subject or body. I don't need to retrieve the entire message, only the subject and body for all messages on a given day so that I can evaluate them with a regular expression for a token.
I looked at EAGetMail as a solution, but their implementation doesn't do what I need to to do. I can only get all information on mail, which only has the size and index. I would need it by subject, but even then I don't want to get everything in inbox. If I went with this solution I have to get all mail, and then retrieve each mail message individually to evaluate the subject and body. This is not ideal.
I also looked at OpenPop.Net, but it too does not have a targeted retrieval for today's messages only.
Can I even do what I want without looping through every single email on the server until I find a match? What is the best way to accomplish what I am trying to do? Am I going to have to build a custom web request to get the data I want? Also, I looked at Chilkat, but I am looking for a free solution, even if it means building the http request myself.
dont know if this helps you at all because it is vb.net however, if you combine with the other link it may help.
http://www.codeproject.com/KB/smart/EmailClient.aspx

Identify if an email address is 'public'

I would like to identify if an email address comes from a public provider or is from an established business. I consider public email addresses to be things such as:
Open email service providers, such as
gmail, hotmail and yahoo.
Anonymization services, such as mailinator or dispostable.
I'm aware that there is no foolproof way to do this, and obviously any list based solution would require constant updates.
Is there a public listing or .NET library that can do this for me?
Are there really that many free webmail providers out there? I would go with a 'blacklisting' style solution.
For example, flag everything in this wikipedia list as free (heck I would think covering gmail/hotmail/yahoo/aol would cover a huge % of users anyway). Then if you get more than 2 (or higher number if your site has high throughput) registrations from the same email domain, it notifies the admin to check the domain to see if it needs to be added to the 'blacklist'.
I would imagine there are much more reliable ways to detect business customers though. For example in Australia you could just ask for an ABN and then check that it's valid. Are you willing to punish small business who don't have email providing and just use a generic #gmail account?
Here is a link to SpamAssasin's freemail list: http://svn.apache.org/repos/asf/spamassassin/trunk/rules/20_freemail_domains.cf.
I suppose, checking against this list is a good start.
You might want to talk to the Better-Business-Bureau ( http://www.bbb.org ) and see if they provide some kind of a feed or API. I had a quick look at their site and couldn't see anything obvious, but it would be this kind of organisation I would head to first if I wanted to find out domain names belonging to established businesses. They do have a form on their site to search by email address ( http://www.bbb.org/us/Find-Business-Reviews/ )
Consider using HubSpot blocked domains list. It is not a guarantee that it is 100% accurate or complete.
They also provide a CSV file that you can download and parse programmatically. Link to CSV file is in the linked page.
I am guessing the ultimate goal is to clean your database from unwanted contacts that will increase the monthly bill. What you can do is the following:
Create a webhook that is triggered whenever a new contact is added.
In that webhook (which can be written in any language), check if the contact is in a blacklist (which is gmail/etc...).
Remove the contact if it is in a blacklist using an API call (you will need to first get the contact ID, which can be easily retrieved using API).

How to read any email account from a domain using C#?

I guess this is sort of two questions that are tied together.
Related questions have discussed how to read and parse email using pop3. I need to be able to do this, however, I want this to be able to work with any email address I need.
I am trying to allow users to submit content by emailing it to a unique email address, which will automatically know to which account the content should be associated.
Is there a good way to create these email addresses on the fly in C# and check these email accounts so for content submissions?
Alternatively is there a way to make a "wildcard" email account which gets all of the email sent to the domain and allows me to see what the to address was?
Most email servers will allow you to route all undeliverable email to a specific mailbox (though the details on how to do it will depend on the mail server). From there you should be able to get the address it was sent to from the To header of the message.
A much better method is to skip the inbox/POP-checking altogether and have your MTA (Message transfer agent) "send" incoming emails straight to your application.
Here's an example setup with PHP: http://www.evolt.org/incoming_mail_and_php
Alternatively is there a way to make a
"wildcard" email account which gets
all of the email sent to the domain
and allows me to see what the to
address was?
Yes its called catch all:
http://en.wikipedia.org/wiki/Catch-all
It depends on your domain host/who you are using to handle your email on the specifics of how to do it.

E-Mail Existence Check in C#

I want to verify whether an e-mail is real or not. Some body told me I could do it with DNS check but I don't know how to do this.
Could somebody help me through this problem and I am developing with C#.
Thanks in advance.
I guess this code-project article gives you the information you want: Effective Email Address Validation
But even if you confirm that a domain is valid, it is still not guaranteed that the email address/recipient is valid. E.g. "xyz#stackoverflow.com" -> the domain is valid, but "xyz" might not be a valid email address.
You can use DNS to determine if a domain is valid/resolving. That wouldn't necessarily mean that a given email address at that domain is valid. The only way to know that is to open an SMTP connection and try to send mail to that user.
Never done this myself, but there appears to be a pretty good C# walkthrough here.
DNS check would imply parsing out the domain attached to the email address in question and making sure it resolves/exists.
Be aware that checking that the domain resolves/exists could take time since your application would need to wait for a response from whatever service you use to check if it exists.

Categories

Resources