DNS Client Utility
DNS Client utilityThis is a cut down version of the DNS client, which can be used toretrieve the MX (mail exchange) record for any Internet address from aDNS server. You can use this MX record to send e-mails directly withoutthe need for any mail server as a host. The library can be compiled toa DLL file. One test program is also given to show all the mailexchanger records for any particular address. More information on DNScan be found from these RFCs.Rfc1034(http://www.ietf.org/rfc/rfc1034.txt) andrfc1035(http://www.ietf.org/rfc/rfc1035.txt). Once you got the MXrecord, you can directly opens its SMTP port, and can issue the SMTPcommands. You may get more than one record for some sites. In that casedo a sorting based on the preference. The lowest value is the mostpreferred address. (With a small change it can work on Beta 1 also)
Source code for DnsLite.cs
Source code for test.cs
The compile strings for both .cs files is included in the .cs files.
Here is a sample session, which is sending mail to a hotmail account directly.
1) Test hotmail.com
This will return all the MX records for hotmail.com
2) Do telnet to one of the address got from the program (to port 25)
telnet mc1.law5.hotmail.com 25
3) Issue the following SMTP commands.
HELO jaimonmathew
MAIL FROM: god@heaven.org
RCPT TO: jaimonmathew@hotmail.com
DATA
From: god@heaven.org
Subject: Just another message from God
First Line
Second ….
Last Line
.
QUIT




30. Dec, 2005 by 







No comments yet... Be the first to leave a reply!