电子邮箱email验证实例程序 function IsValidEmail(email) dim names name i c Check for valid syntax in an email address IsValidEmail = true names = Split(email "@") if UBound(names) <>then IsValidEmail = false exit function end if for each name in names if Len(name) <= then IsValidEmail = false exit function end if for i = to Len(name) c = Lcase(Mid(name i )) if InStr("abcdefghijklmnopqrstuvwxyz_ " c) <= and not IsNumeric(c) then IsValidEmail = false exit function end if next if Left(name ) = " " or Right(name ) = " " then IsValidEmail = false exit function end if next if InStr(names( ) " ") <= then IsValidEmail = false exit function end if i = Len(names( )) InStrRev(names( ) " ") if i <>and i <>then IsValidEmail = false exit function end if if InStr(email " ") >then IsValidEmail = false end if
lishixinzhi/Article/program/net/201311/14046在数据库里面设置一个字段来标识是否已经验证过。
然后在用户输入邮箱后,就发一个邮件到那个邮箱地址,邮件里面含一个激活链接,用户点那个链接后,就更新数据库中的字段为已经验证状态。如果用户修改了邮箱,则重新验证。
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)