Link to home
Start Free TrialLog in
Avatar of piechev
piechev

asked on

Can't get .NET System.Web.Mail classes or cdonts.dll to work on NT4 even after installing NT4 Option Pack

I have a simple .NET executable using the System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail classes.
My C# code works fine on my Windows 2000 machine, but the same code doesn't work on my NT4 machine.
At first, I was getting an error message about cdonts.dll.  Then I installed the NT4 Option Pack.  The errors went away, but the email never arrives at the destination when I run the program from the NT4 machine.
In the system event log, there is the following "red" event: "Server events initialization failed for virtual server 1. Server events may not be called for this virtual server. (Event ID 1002, Source SMTPSVC)."  But it seems this message was produced by the NT4 Option Pack install because running my email executable does not make an event log entry.
Here's the code.
MailMessage MyMail = new MailMessage();
MyMail.From = strFrom;
MyMail.To = strTo;
MyMail.Subject = strSubject;
MyMail.Body = strBody;          
SmtpMail.SmtpServer = strSmtpServer;
SmtpMail.Send(MyMail);
Please help.
Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of God_Ares
God_Ares

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of God_Ares
God_Ares

yes you can send mail with telnet ;)