| ASP MX Component | ||||||||||||||||||||||||||||||||||||||||||||||||
|
ASPMX is an ASP component that provides simple DNS lookup of mail exchanger MX records. This is useful in applications where you need to know the hostname of the mail exchanger(s) for a given domain. For example, if someone provides you with an email address like joebloggs@microsoft.com, ASPMX will lookup the names and priorities of the mail servers that are registered as mail exchangers for microsoft.com. The Component can also be used to validate an email address. It does this by attempting to connect to the lowest cost mail exchanger and simulating an SMTP transmission for the email address passed. In general, this can be used to determine whether the email address joebloggs@microsoft.com really exists (or at least whether mail will be accepted for the user). The component is a form of freeware that I call donationware. It can be downloaded from here (1,499,319 bytes). If you have Visual Basic V6.0 SP5 runtimes and the Microsoft Winsock Control V6.0 SP5 already loaded on your system, you can download the bare DLL (106,496 bytes) by clicking here. You can then register it yourself using regsvr32.exe. If you are not fully conversant with component registration or are not sure if you have the required runtimes, rather download the full installation. | ||||||||||||||||||||||||||||||||||||||||||||||||
| ASP MX Component Properties & Methods | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Sample ASP Code for using the component | ||||||||||||||||||||||||||||||||||||||||||||||||
<%
Dim DNSMX ' Instance of the component
Dim A ' A temporary String
Set DNSMX = Server.CreateObject("ASPMX.Resolver") ' Create the Component
DNSMX.DNSServer = "196.25.1.1" ' Set the DNS Server to user
DNSMX.Domain = "microsoft.com" ' Set the domain to lookup
DNSMX.TimeOutValue = 10 ' Set the Timeout value to 10 seconds
A = DNSMX.Resolve() ' Attempt resolving the MX record(s)
If Len(A) > 0 Then
Response.Write "Error : " & A
Else
Response.Write "There are " & DNSMX.MXCount & " records :"
For X = 1 To DNSMX.MXCount
Response.Write "<BR>" & DNSMX.MX(X) & " (" & DNSMX.MXPriority(X) & ")"
Next
End If
DNSMX.TimeOutValue = 30 ' Change Timeout value to 30 seconds
DNSMX.Sender = "tester@microsoft.com" ' Set the sender email address to use
A = DNSMX.ValidateEMail("bill@microsoft.com") ' See if bill@microsoft.com is valid
If Len(A) = 0 Then ' If the response is of zero length, it is valid
Response.Write "bill@microsoft.com exists"
Else ' If not, an error occurred or there is
Response.Write A & "<BR>" ' no such user. Write the error.
A = DNSMX.ViewConversation() ' Also write details of the last
A = Replace(A,vbcrlf,"<BR>") ' SMTP conversation for debugging
Response.Write "The error might be due to an " ' purposes.
Response.Write "SMTP error. The last "
Response.Write "conversation went as follows:"
Response.Write "<BR>" & A
End If
Set DNSMX = Nothing
%>
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Downloads | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Revision History | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Donationware | ||||||||||||||||||||||||||||||||||||||||||||||||
|
As every programmer knows, a fair amount of time goes into developing a product. Programmers are normally nice guys but are not the sharpest business people. As a result, we tend to give away things for free. DONATIONWARE is my idea of letting you make a contribution if you feel that you would like to. So, if you like the software and feel that it saved you time, you can make a US$10 contribution. Or you can just use it for free and feel bad about it ;). Either way, the software is the same. It still works and it is not crippled. You will not receive a new super version of the component when you register. The free and the registered versions are the same. You do not HAVE to buy it, but if you want make a contribution, feel free to do so by clicking here or by clicking on the button below. Thanks ;)
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Disclaimer | ||||||||||||||||||||||||||||||||||||||||||||||||
This component is provided as is and without any guarantees or promises. You use it entirely at your own risk. It was written with care but cannot be certified to contain no bugs or errors. You also cannot hold me responsible if it crashes your server or starts World War III. Since it's free, I do not guarantee performance, support or error-free operation. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Contact Information | ||||||||||||||||||||||||||||||||||||||||||||||||
This Webpage was written in a great hurry, so please don't judge the component on the appearance of this page. One day when I grow up, I'll make a decent page. If you wish to mail me any comments, feel free to do so at stefan@internext.co.za | ||||||||||||||||||||||||||||||||||||||||||||||||
|