E-Mail Validation in asp.net

Posted by Ujjal under ASP.NET on 1/3/2012 | Points: 10 | Views : 5153 | Status : [Member] | Replies : 9
Can we verify an email id whether it's exist or not in asp.net 2.0 ?




Responses

Posted by: Prabhakar on: 1/3/2012 [Member] [MVP] Starter | Points: 25

Up
0
Down
hi Ujjal ,

if u want valid Email ID so use RegularExpressionValidator . . .

<asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="tbEmail" ErrorMessage="Invalid Email Format"></asp:RegularExpressionValidator>

and if u want check Exits or not . . so use RequiredFieldValidator

<asp:RequiredFieldValidator runat="server" id="reqName" controltovalidate="txtMail" errormessage="Please enter your EMail !" />


Best Regard's
Prabhakar

Ujjal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ujjal on: 1/3/2012 [Member] Starter | Points: 25

Up
0
Down
Thnx Mr. Prabhakar for your kind response but what i wants to check that whether that email id exists physically or not means
if i will send any mail to any fake email id then it should show me the error that email id doesn't exists.

Hope you will get my point.

Ujjal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yoosuf.t on: 1/3/2012 [Member] Starter | Points: 25

Up
0
Down
just watch the link http://www.email-unlimited.com/tools/verify-email.aspx

Ujjal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yoosuf.t on: 1/3/2012 [Member] Starter | Points: 25

Up
0
Down
and some coding available at http://www.codeproject.com/KB/validation/Valid_Email_Addresses.aspx

Ujjal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ujjal on: 1/4/2012 [Member] Starter | Points: 25

Up
0
Down
Thnx Mr. Yoosuf for sharing the link.

Ujjal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ujjal on: 1/4/2012 [Member] Starter | Points: 25

Up
0
Down
The Above link is not working properly if any one have implemented something like this then kindly share d link or d code.

Ujjal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 1/4/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
You need an SP that will check if an Email Exist, something like this


GO
/****** Object: StoredProcedure [dbo].[sp_CheckemailExistance] Script Date: 01/04/2012 10:51:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_CheckemailExistance]
(
@EMAIL varchar(40),
@RESULTS INT OUTPUT
)
AS

SET @RESULTS = (SELECT COUNT(*) FROM
USERS WHERE EMAIL = @EMAIL)


Thank you for posting at Dotnetfunda
[Administrator]

Ujjal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ujjal on: 1/4/2012 [Member] Starter | Points: 25

Up
0
Down
@Vuyiswamb It will the check the duplicate value of email id in the database means whether that email id exists in my table or not but i wants to check whether that email id is fake or not while registering in my website so that it will not bounce back.

For an example just check this link http://www.email-unlimited.com/tools/verify-email.aspx




Ujjal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 1/4/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
The only way you can do this , so to send an email to that user , and he must click a link to confirm that his Email is Legit , if the email was not Correct the email will not be sent anywhere.


Thank you for posting at Dotnetfunda
[Administrator]

Ujjal, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response