如何检查输入的电子邮件ID是否有效 [英] How do i check entered email id valid or not

查看:170
本文介绍了如何检查输入的电子邮件ID是否有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b我想检查用户输入的电子邮件ID是否有效。我正在使用验证来检查电子邮件ID,但我想检查电子邮件ID是真实的还是假的。

Hi i want to check user entered email id is valid or not. i am using validation for checking email id but i want to check that email id is real or fake.

推荐答案

正如您在许多社交网站上看到的那样,一旦您注册该网站,他们将在您注册的电子邮件地址中发送激活链接。一旦你注册,你将被激活。



由于这个激活链接,他们可以知道注册的电子邮件地址是正确的。



例如:



如果我注册电子邮件地址a@a.com,那么我的验证将通过这个电子邮件地址,因为它只会检查邮件的格式,而不是这封电子邮件是否真的存在。



因此,为了确认注册的电子邮件地址是否正确,他们将发送带有激活链接的电子邮件。如果我没有该电子邮件地址,我将无法登录并点击激活链接。因此,经过一段时间,如果我没有激活,他们将删除我的注册。



以同样的方式,你可以按照这个过程。



问候,

CodeBlack
As you have seen in many of the social networking site, once you register to the site, they will send an activation link in your registered email address. and once you register you will get activated.

Because of this activation link they can come to know that email address registered is correct.

For example :

If I register email address a@a.com then my validation will pass this email address because it will just check the format of the mail not whether this email really exists or not.

So to confirm that whether registered email address is correct or not, they will send an email with activation link. and if I donot have that email address I will not be able to login and click on the activation link. So after some period of time if I donot get activated they will remove my registration.

In the same way you can follow this process.

Regards,
CodeBlack


这个链接可以帮到你。

验证电子邮件地址 [ ^ ]







添加链接文字以反映文章标题。 />
[/编辑]
This link can help you.
Validate an Email Address [^]



Link text added to reflect the article title.
[/Edit]


您可以进行基本检查,看看它是否符合有效的电子邮件地址:有一个'@'字符,双方都足够长,似乎是右侧的域名地址,但您可以做的唯一其他事情是向其发送电子邮件,并返回指向您网站的链接,看看他们是否有回应。如果他们这样做,它是一个有效的电子邮件地址和一个受监控的地址。



我所做的是发送一封电子邮件,其中包含一个包含查询字符串GUID值和用户ID的链接 - 然后我检查id和GUID是否匹配,并且仅当注册完成也是如此。



这不是绝对可靠的:我可以想到至少两个临时电子邮件地址网站,我可以在这里获得一个有效且可监控的电子邮件地址。分钟 - 在此之后它被销毁并且将不再起作用。
You can do a basic check to see if it qualifies as a valid email address: has an '@' character, long enough on both sides, appears to be a domain address on the right, but the only other thing you can do is send an email to it with a link back to your site and see if they respond. If they do, it's a valid email address and one that is monitored.

What I do is send an email with a link containing a query string GUID value and the user ID - I then check that the id and GUID match, and only if so is the registration completed.

This is not infallible though: I can think of at least two "temporary" email address sites where I can get an email address which is valid and monitorable for about ten minutes - after that it is destroyed and won't work any more.


这篇关于如何检查输入的电子邮件ID是否有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆