What do I need to send email in .NET?
First, and foremost, you need the .NET Framework installed. Then you need a reference to the System.Web.dll (automatically included in ASP.NET applications). Then you need to use the System.Web.Mail namespace to create and send email messages.
Because SWM is simply a wrapper around the two COM libraries:
CDONTS.NewMail (found in the cdonts.dll) and CDO.Message (found in the cdosys.dll) you will also need them installed on your server.
If you are using NT4 or Win9x, the cdonts.dll is installed with the NT4 Option pack or with the personal webserver. The cdosys.dll is installed by default on Windows 2003 and on Windows XP. It can also be installed by installing Microsoft Office.
Once you can successfully use SWM, you will need a relay server to send email through. A relay server is a mail server, or a SMTP server/service, that can handle sending email. SWM simply sends the mail to a relay server, and the relay server is responsible for delivering it to the final destination.
CDOSYS.DLL is part of the OS and is only installed from the OS installs. Office (Outlook actually) can optionally install CDO.DLL which System.Web.Mail does not use.
For information on the various flavors of CDO see:
The four CDOs are (in chronological order):
- CDO.DLL : CDO version 1.2.1
- CDONTS.DLL : CDO version 1.2.1 for Windows NT Server (not the same as CDO version 1.2.1!)
- CDOSYS.DLL : CDO for Windows 2000
- CDOEX.DLL : CDO for Exchange 2000 Server
FWIW: CDOEX.DLL is installed as part of Exchange Server installs.
Copyright © 2004 Contact: Dave Wanta.