我该如何验证电子邮件? [英] How can I validate email?

查看:110
本文介绍了我该如何验证电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到这不仅仅是一个ASP问题,但我认为你们可能会知道答案,但我无法在其他地方发现这个问题。如果您有这方面的建议,我非常乐意在其他地方发帖。


我如何使用ASP代码验证是否有电子邮件地址是

真实的?例如,如果我有一个名为 ro*@rogers.net 的电子邮件地址

我如何确定它是否是真的吗?

I realize this is not solely an ASP question, but I thought you guys might
know the answer and I couldn''t find anywhere else to post this. If you have
suggestions for this I am more than happy to post somewhere else.

How can I, using ASP code, validate whether or not an email address is a
real one? For example, if I have the email address called ro*@rogers.net
how can I determine if it is real?

推荐答案

可以做一般的模式搜索


一些alpha字符+一个@符号+一些alpha chars +一个fullstop然后是2

或者3个字母


我会猜到它的大部分内容


michaaal <再****** @ verizon.net>在留言中写道

新闻:%2 *************** @ TK2MSFTNGP10.phx.gbl ...
Could just do a general patter search

some alpha chars + an @ symbol + some alpha chars + a fullstop followed by 2
or 3 letters

that'' catch most of it i guess

"michaaal" <re******@verizon.net> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
我意识到这一点不仅仅是一个ASP问题,但我认为你们可能会知道答案,我无法在其他任何地方发现这个问题。如果您对
有这方面的建议,我非常乐意在其他地方发帖。

我如何使用ASP代码验证电子邮件地址是否真实?
一?例如,如果我有一个名为 ro*@rogers.net 的电子邮件地址
我如何确定它是否真实?
I realize this is not solely an ASP question, but I thought you guys might
know the answer and I couldn''t find anywhere else to post this. If you have suggestions for this I am more than happy to post somewhere else.

How can I, using ASP code, validate whether or not an email address is a
real one? For example, if I have the email address called ro*@rogers.net
how can I determine if it is real?



michaaal写道:
michaaal wrote:
我意识到这不仅仅是一个ASP问题,但我认为你们是
可能知道答案,我无法在其他任何地方找到这个。
如果您对此有任何建议,我非常乐意在其他地方发布

我如何使用ASP代码验证电子邮件地址是否真实?例如,如果我有一个名为
的电子邮件地址 ro*@rogers.net ,我如何确定它是否真实?
I realize this is not solely an ASP question, but I thought you guys
might know the answer and I couldn''t find anywhere else to post this.
If you have suggestions for this I am more than happy to post
somewhere else.

How can I, using ASP code, validate whether or not an email address
is a real one? For example, if I have the email address called
ro*@rogers.net how can I determine if it is real?




6个月前我有同样的问题,结论这里有3个级别

到此:

1)在电子邮件上进行正则表达式以确定它是否与有效电子邮件的语法相符

地址。


注意:要真的获得最细粒度的结果,你必须根据RFC标记

电子邮件地址。你会感到惊讶的是什么是有效的电子邮件,并且

什么不是。


2)检查域名的MX记录电子邮件,以确保它是一个有效的域,

并接受电子邮件。


3)实际上连接到有问题的MX,并询问服务器,如果它是一个地址。


有几个选项。如果你想使用VBScript,可以在

互联网上找到一些教程...但它们并没有像商业产品那样定义好。我

购买了 http://www.hexillion.com / hg / HexValidEmail / ,它很棒。这很简单......

而且相当便宜。我节省了多少时间是值得的。


您可以在ASP环境中使用PerlScript,而Perl有许多模块可以有效地完成所有三个这些东西,他们是免费的。因此,如果您的系统上有/ b
perlscript并且知道如何安装模块,请转到
http://search.cpan.org 并找出你需要的那些。


Eric



I had the same question 6 months ago, and came to the conclusion here are 3 levels
to this:

1) To do a regexp on the email to determine if it matches syntax for a valid email
address.

Note: To really get the most fine-grained results you''d have to tokenize the
email address according to the RFC. You''d be surprised what''s a valid email, and
what''s not.

2) Check the MX records of the domain of the email to make sure it''s a valid domain,
and is accepting email.

3) Actually connect to the MX in question, and ask the server if it''s an address.

There a few options. If you want to use VBScript there are a few tutorials on the
internet... but they aren''t nearly as well defined as the commercial offerings. I
bought http://www.hexillion.com/hg/HexValidEmail/, and it''s great. It''s simple...
and pretty cheap. For how much time I saved it was worth it.

You could use PerlScript in the ASP environment, and Perl has many modules that
effeciently do all three of these things, and they are free. So if you have
perlscript on your system and know how to install modules, go to
http://search.cpan.org and figure out which ones you''ll need.

Eric


" Eric Gibson"在消息中写道

新闻:JX **************** @ bignews6.bellsouth.net ...

:michaaal写道:

:>我意识到这不仅仅是一个ASP问题,但我认为你们是

:>可能知道答案,我找不到其他任何地方发布这个。

:>如果您对此有任何建议,我非常乐意发布

:>在其他地方。

:>

:>如何使用ASP代码验证是否有电子邮件地址

:>是真的吗?例如,如果我的电子邮件地址名为

:> ro*@rogers.net 如何判断它是否真实?



:我在6个月前遇到了同样的问题,并在此结论是

3级

:对此:



:1)对电子邮件进行正则表达式以确定它是否与

有效电子邮件的语法相符

:地址。



:注意:要真正获得最细粒度的结果,你必须



标记为:根据RFC的电子邮件地址。你会感到惊讶的是什么是有效的

电子邮件,并且

:什么不是。



:2)检查电子邮件域的MX记录,确保它是有效域名

:并接受电子邮件。



:3)实际连接到有问题的MX,并询问服务器是否是

地址。



:有几种选择。如果你想使用VBScript,那么在

:internet上有一些教程

...但是它们的定义并不像商业广告那么好>
产品。我

:购买了 http://www.hexillion。 com / hg / HexValidEmail / ,它很棒。它的价格很简单......

:非常便宜。我节省了多少时间是值得的。



:你可以在ASP环境中使用PerlScript,Perl有很多模块



:有效地完成所有这三件事,并且他们是免费的。所以,如果你在你的系统上有

:perlscript并且知道如何安装模块,请转到

http://search.cpan.org 并找出你需要的那些。

由于现在有全部电子邮件帐户,所以仍然不会确定。

尝试使用AOL,您会发现所有电子邮件地址都有效。


-

Roland Hall

/ *这些信息的分发是希望它有用,但是

没有任何保证;甚至没有适销性的暗示保证

或特定用途的适用性。 * /

Technet脚本中心 - http:// www .microsoft.com / technet / scriptcenter /

WSH 5.6文档 - http://msdn.microsoft.com/downloads/list/webdev.asp

MSDN Library - http://msdn.microsoft.com/library/default.asp
"Eric Gibson" wrote in message
news:JX****************@bignews6.bellsouth.net...
: michaaal wrote:
: > I realize this is not solely an ASP question, but I thought you guys
: > might know the answer and I couldn''t find anywhere else to post this.
: > If you have suggestions for this I am more than happy to post
: > somewhere else.
: >
: > How can I, using ASP code, validate whether or not an email address
: > is a real one? For example, if I have the email address called
: > ro*@rogers.net how can I determine if it is real?
:
: I had the same question 6 months ago, and came to the conclusion here are
3 levels
: to this:
:
: 1) To do a regexp on the email to determine if it matches syntax for a
valid email
: address.
:
: Note: To really get the most fine-grained results you''d have to
tokenize the
: email address according to the RFC. You''d be surprised what''s a valid
email, and
: what''s not.
:
: 2) Check the MX records of the domain of the email to make sure it''s a
valid domain,
: and is accepting email.
:
: 3) Actually connect to the MX in question, and ask the server if it''s an
address.
:
: There a few options. If you want to use VBScript there are a few tutorials
on the
: internet... but they aren''t nearly as well defined as the commercial
offerings. I
: bought http://www.hexillion.com/hg/HexValidEmail/, and it''s great. It''s
simple...
: and pretty cheap. For how much time I saved it was worth it.
:
: You could use PerlScript in the ASP environment, and Perl has many modules
that
: effeciently do all three of these things, and they are free. So if you
have
: perlscript on your system and know how to install modules, go to
: http://search.cpan.org and figure out which ones you''ll need.
This still won''t be a definite since there are catch-all email accounts now.
Try it with AOL, and you''ll see all email addresses respond as valid.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


这篇关于我该如何验证电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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