Solved

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

Posted on 2004-08-25
4
226 Views
Last Modified: 2010-04-15
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.
0
Comment
Question by:piechev
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
God_Ares earned 500 total points
ID: 11950212
Trust me on this one,... skip the system.web.mail,.. use other components.

use third party components,.. here is a quick start: http://www.codeproject.com/csharp/sendmailcsharp.asp

regards,.. Floris Briolas
0
 
LVL 7

Expert Comment

by:God_Ares
ID: 11950216
yes you can send mail with telnet ;)
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question