C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Email vaildation


Posted Date: 20 Sep 2008      Posted By: dineshbabu      Member Level: Silver     Points: 1   Responses: 4



Hi friends
How to find a email id is exist or not......if its not possible to do in coding refer any third party tool even it may be licensed software, to integrate in my application





Responses

Author: Hefin Dsouza    20 Sep 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 4

One Thing that you can do is to validate the email by an regular expression validator.Then send an email to that email id and verify an verification code.Then validate that code.Which is done by most of the applications.

This is a regular method.
If you tell me what type of application you are developing.
Wether it is an Windows Application or an Web Application.

Regards Hefin Dsouza

Regards Hefin Dsouza
WebMaster, DotNetSpider.com

DotNetSpider MVM

My Communities
http://www.dotnetspider.com/sites/10/-RND-DEVELOPERS.aspx
http://www.dotnetspider.com/sites/409/-MCTS-Preparation-Team.aspx
DotNet the Hefin Way!



Author: Vidhya    20 Sep 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 6

a three step validation process..

1) syntax validation- which is pretty straight forward

2) DNS validation - I'm able to do this too.

3) mailbox validation - I have read in many forums saying it is IMPOSSIBLE to check whether a particular email id exists. But take a look at this site.

http://www.dimplesoftwares.com/emai...orlivedemo.aspx

When they can do it there has to be some way. I have searched every nook and corner but to no avail.. Any help would be greatly apppreciated

public void ValidateMailBox(string emailAddress)
{
string[] id = emailAddress.Split('@');
string host = id[0];


if (!CheckSmtpServerResponse(sock, SmtpServerResponse.CONNECT_SUCCESS))
{
sock.Close();
bConnectStatus = false;
}
else
{
bConnectStatus = true;
}

SendData(string.Format("HELO {0}\r\n", Dns.GetHostName()));
if (!CheckSmtpServerResponse(sock, SmtpServerResponse.GENERIC_SUCCESS))
{
sock.Close();
bHelloStatus = false;
}
else
{
bHelloStatus = true;
}

SendData(string.Format("MAIL From: {0}\r\n", "test@yahoo.com")); //_SenderEmail));
if (!CheckSmtpServerResponse(sock, SmtpServerResponse.GENERIC_SUCCESS))
{
sock.Close();
bBlackListStatus = false;
}
else
{
bBlackListStatus = true;
}

SendData(string.Format("RCPT TO: {0}\r\n", "test2@gmail.com"));
if (!CheckSmtpServerResponse(sock, SmtpServerResponse.GENERIC_SUCCESS))
{
sock.Close();
bSendStatus = false;
}
else
{
bSendStatus = true;
}
}

public void SendData(string message)
{
byte[] bytes = System.Text.Encoding.ASCII.GetBytes(message);
sock.Send(bytes, 0, bytes.Length, SocketFlags.None);
}

public bool CheckSmtpServerResponse(Socket soc, SmtpServerResponse code)
{
string responseString;
int responseCode;
byte[] bytes = new byte[1024];
while (sock.Available == 0)
{
System.Threading.Thread.Sleep(100);
}
sock.Receive(bytes, 0, sock.Available, SocketFlags.None);
responseString = System.Text.Encoding.ASCII.GetString(bytes);
responseCode = Convert.ToInt32(responseString.Substring(0, 3));
if (responseCode != (int)code)
{
return false;
}
else
{
return true;
}
//return responseCode.Equals(Convert.ToInt32(code));
}

I hope this helps you!

Regards,
Vidhya



Author: Hefin Dsouza    20 Sep 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 3

According to what Vidhya
This is using Syntax we can validate.
One more thing we can also send a mail to the user and validate it using an Code.

I ll work onit and send you a response as soon as possible.

Regards Hefin Dsouza

Regards Hefin Dsouza
WebMaster, DotNetSpider.com

DotNetSpider MVM

My Communities
http://www.dotnetspider.com/sites/10/-RND-DEVELOPERS.aspx
http://www.dotnetspider.com/sites/409/-MCTS-Preparation-Team.aspx
DotNet the Hefin Way!



Author: Nagamohan kumar P    22 Sep 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 6

For this you can use the web service
rt click on solution explorer and add web reference
copy this link and add
http://www.webservicex.net/ValidateEmail.asmx?wsdl
ASPX Body
-----------
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Enter Email Address"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" Visible="False">Validate</asp:LinkButton><br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Check Email" /><br />
<asp:Label ID="lblmsg" runat="server" Font-Bold="True" Height="22px" Width="437px"></asp:Label></div>
</form>
</body>
-----------------------------------------
ASPX.CS
------------------------------------------


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using net.webservicex.www;
public partial class TestSms : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{




}

protected void Button1_Click(object sender, EventArgs e)
{
lblmsg.Text = "";
lblmsg.ForeColor = System.Drawing.Color.White;
string emal = TextBox1.Text;
net.webservicex.www.ValidateEmail emil = new net.webservicex.www.ValidateEmail();
bool val = false;
val = emil.IsValidEmail(emal);
if (val == true)
{
lblmsg.Text = " Is Valid Email";
lblmsg.ForeColor = System.Drawing.Color.Green;
}
else if (val == false)
{
lblmsg.Text = " Invalid Email";
lblmsg.ForeColor = System.Drawing.Color.Red;
}
}
}



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : action event for dynamic checkbox control
Previous : problem in datetime datatype
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use