TcpClient

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Hi all

mytcp = new TcpClient(POP_server, POP_port);

i have the above line of code, and it fails with the message "The requested
name is valid, but no data of the requested type was found" which i have
found a similar message (below) in the MSDN library

Valid name, no data record of requested type.
The requested name is valid and was found in the database, but it does not
have the correct associated data being resolved for. The usual example for
this is a host name-to-address translation attempt (using gethostbyname or
WSAAsyncGetHostByName) which uses the DNS (Domain Name Server). An MX record
is returned but no A record-indicating the host itself exists, but is not
directly reachable.

If anyone could help. I would like to know possible steps to fixing this
error?

Thanks
Jason
 
Jason,

If you are connecting to send email, then you need to resolve the MX
record for the domain that the email is attached to. For example, if you
have an email going to:

(e-mail address removed)

Then you would look for the MX record for somedomain.com. Then, you
would have a number of records returned to you. These records have a
preference number, and a DNS name that the mail should be sent to. You
should cycle through these, attempting to connect to the servers identified
by that DNS name. For example, when you get the MX record for
somedomain.com, it might return mail.somedomain.com, and then you look up
mail.somedomain.com. You then connect to that IP address (or that DNS
name).

Hope this helps.
 
Back
Top