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
223 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

759 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now