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.
Related
So I have an application which basically sends an email out, but I want to be able to have multiple users using it, and I need it to check if their login details are correct, which ideally need to be done when entered, but that's not essential, as it sends the email would be fine as well.
I've looked up how to do it, and I read about using an SmtpException, my issue is that I don't actually know how to use it to check if the password is the thing causing the issue.
The other way I found was to use sockets and to check with a tcp/ip layer, however as the program is bespoke for a company, I don't know exactly how their server works, and therefore don't really want to use this method.
Thanks for all your help
The SmtpException thrown will include a status code. See SmptException.StatusCode
It will return an enumeration value of type SmtpStatusCode.
I believe the one you're looking for (to indicate a bad login) is ClientNotPermitted.
To confirm, you can try a test program and provide invalid credentials . . .
Hope that help!
We are looking to create a website that displays information to all new visitors to a site, i.e. welcome, please read our help guide, etc.
The big problem is that our website is not allowed to use long-lasting cookies (i.e. over 20 minutes). Does anybody know of any way we can determine whether a user has visited the site before or not. As another restriction, we can not add anyform of registration to the system.
The application is being created in ASP.Net 3.5.
Thanks for the help
The EFF has a tool/site that you can visit that shows how with the plugins, OS details, browser details, etc. you can determine a visit fairly uniquely. It could give some insight on details to store in a database to determine if the user had been there before:
https://panopticlick.eff.org/
You could attempt to use an IP address, but with NAT'ing and most ISPs handing out dynamic IP addresses anyways, you'll never really know if the user visiting is one who's been there before or not with any certainty.
If you have no way of storing information on the client side, this is impossible except for saving IPs and comparing those, which isn't really accurate either.
Does anybody know of any way we can determine whether a user has visited the site before or not.
No, you can't. Since you can't use cookies all you've got is what the client's sending by default: IP address, user agent information. With the current IPv4 depletion and the popularity of NAT devices the IP is anything but useful.
About the only way is to capture the IP address of web browser and use that as a unique ID - assuming that it is indeed unique.
You can't rely on the IP since it can be shared by many user, or change for one user.
If you can't store a cookie on the client side, it is not possible.
You can also ask him: "Did you ever visited this site in the past?", but I doubt this is good practice :D
Store a boolean value like "AlreadyVisited" in the Session. So everytime the user visits the page for the first time, he will see your welcome message.
After displaying, set the boolean to false (you need to store it in the session)
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.
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.
Well, for my program(s) I'd like to let the user send me an e-mail with any errors. Instead of relying on a forsaken SMTP server, I decided to let the user use his very own e-mail client to send an e-mail to a specified address.
So what I need is:
A sender (should not be changeable) (example: mysupportemail#gmail.com)
An attached file (should not be changeable) (example: "C:\a file.log")
(Optional) A body (changeable)
I hope it is possible!
You can use the mailto command for this. See http://msdn.microsoft.com/en-us/library/aa767737(VS.85).aspx for more information. Some mail clients support attachments on this. See the comments of the MSDN page for some information on this.
The mailto protocol has limitations, such as not being able to specify an attachment (some mail clients support it, but it's not in the official protocol). Your best option is probably to use the MAPISendMail function to let MAPI do the hard work. See this article for details:
Sending files via the default e-mail client
I used this technique in the past, it seems to work perfectly.
Using mailto directly from you application cause potential problems. If you have specified mail account for receive e-mails you can be sure, that someone will use it somehow to sent you spam or thousands unwanted emails. In our company we struggled with this problem many times - at last, we decided to allow our customers to report problems in any other way - web page form.
Now, when customer click 'report problem' this option displays a form for reporting bugs in default web browser. Opened link include some additional information which causing partial fill of the form opened by customer. Now, we have an intermediate layer and absolute control on server side who report problem (ip) and we can limit reporting for specified users. Next advantage of these solution is that you can forward emails to different departments depending on what form fields are marked/filled with.
Well, I have found the perfect solution!
For those who want to see it...
http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/a75533eb-131b-4ff3-a3b2-b6df87c25cc8
http://www.eggheadcafe.com/community/aspnet/2/10019665/email-through-gmail-in-c.aspx