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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 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

13 Experts available now in Live!

Get 1:1 Help Now