473,387 Members | 3,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

validating the domain of a mail address

Hi All,
I have a case where i need to validate if the email address is valid
before i send a mail. for this there are 2 parts..
* check the format of mail address - this is done
* check the validity of the domain - for this do i need to connect to
domain name( example yahoo.com , port 25 )using TCP/Ip to the server
and then check to see if i receive correct responses. I am confused by
the use of SmtpServer in System.Web.Mail.. what is this server for??
If the machine in which i am working in allows all sockets to connect
can i directly create a tcp/ip socket and check the domain??
Nov 16 '05 #1
2 2840
Arun,

You have to check whether your email address comply with RFC822.

RFC 822 checks Quoted Identifier, Local Part and Domain in any given email
address.

There are some samples available in c# to check that.

Shak.
"ArunPrakash" <ar**********@yahoo.com> wrote in message
news:61*************************@posting.google.co m...
Hi All,
I have a case where i need to validate if the email address is valid
before i send a mail. for this there are 2 parts..
* check the format of mail address - this is done
* check the validity of the domain - for this do i need to connect to
domain name( example yahoo.com , port 25 )using TCP/Ip to the server
and then check to see if i receive correct responses. I am confused by
the use of SmtpServer in System.Web.Mail.. what is this server for??
If the machine in which i am working in allows all sockets to connect
can i directly create a tcp/ip socket and check the domain??

Nov 16 '05 #2
I'd recommend not trying to validate. It's just not worth it. You can't use
the SmtpServer class for that; you'd have to open a socket, connect to the
server (the one that handles MX records for the domain you're sending to,
not the SMTP server) and do the whole thing manually.

The SmtpServer class is the address of the mail relay you use to send the
mail.

But yeah, you can do it manually over TCP/IP, sure.
--
Klaus H. Probst, MVP
http://www.vbbox.com/
"ArunPrakash" <ar**********@yahoo.com> wrote in message
news:61*************************@posting.google.co m...
Hi All,
I have a case where i need to validate if the email address is valid
before i send a mail. for this there are 2 parts..
* check the format of mail address - this is done
* check the validity of the domain - for this do i need to connect to
domain name( example yahoo.com , port 25 )using TCP/Ip to the server
and then check to see if i receive correct responses. I am confused by
the use of SmtpServer in System.Web.Mail.. what is this server for??
If the machine in which i am working in allows all sockets to connect
can i directly create a tcp/ip socket and check the domain??

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Dunaway | last post by:
I have a form with a textbox and numerous panels, buttons and other controls. I have handled the textbox Validating and Validated events. The textbox will hold a filename. In the validating...
12
by: ll | last post by:
I am trying to finalize a regular expression in javascript to only allow emails with a certain domain to be valid. Here is what I have so far: var emailFilter2=/\@aol.com/;...
5
by: praveenb000 | last post by:
$to = $contacts; //'***@gmail.com'; $subject = 'Job Requirements from Recruiter(Broad Light)'; //$adminMainR = $_SESSION; $adminMainR = "***@3kits.com"; $headers =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.