(There is a note about extra reliability after the instructions.)
1. Download the binaries SendMail.class, SendMailNotDeliverException.class & SendMailResponseException.class and the sample
ASP page tryit.asp. After you download the above three .dat files,
rename them from .dat to .class. From the NT command prompt, you can use the command: rename
*.dat *.class
2. Place the SendMail*.class files in your Win NT Java Trusted Libraries folder. To do this, you can enter at the NT command prompt:
mkdir %SystemRoot%\Java\TrustLib\COM\rajiv\net
(If Win NT Command Extensions are not enabled, you will need to create the COM
folder, then the rajiv folder, then the net folder. To place the
files in the folder, you can enter at the command prompt:
copy /b SendMail*.class %SystemRoot%\Java\TrustLib\COM\rajiv\net
3. Register the class as a Active Server Component. To do this, you need the javareg
program which is freely available at http://www.microsoft.com/java/
as a part of their free Java SDK. You may also have this utility if you have Visual J++.
At the NT command prompt, enter:
javareg /register /class:COM.rajiv.net.SendMail /progid:COM.rajiv.net.SendMail
4. Restart your Internet Information Server. This means shutting down all IIS services and restarting them. If you are running IIS services besides w3svc & msftpsvc (like gopher in IIS 3.0), you should include that in the restart.
If you are running MS IIS 3.0, use the IIS Manager GUI, or at the command prompt
net stop w3svc & net stop msftpsvc & net start msftpsvc & net start w3svc
If you are running MS IIS 4.0, use the MS Management Console on IIS, or at the command prompt
net stop iisadmin /y & net start msftpsvc & net start w3svc
5. Place tryit.asp in a web folder with script access, change the e-mail addresses and headers to your own for testing and test the script.
Note: When using this on a web server from ASP or CGI, you can get extra reliablity by installing a mail server locally. Then, when using this object's setSMTPServer(String) method, specify the local host as the mail server instead of your primary mail server. That enables queuing of mail for later delivery attempts when your primary mail server is not accessible. Pick a freeware mail server that is simple, reliable, lightweight and has minimal overhead. For security, configure the system such that only the machine itself can use this local mail server to send outgoing mail.