System.Web.Mail FAQ

Complete FAQ Listing


1.3 What do I need to send email in .NET? Printer Friendly   Email This FAQ   Discuss

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.

Update
I got this email from Jay Harrlow, an Outlook MVP who corrected me about this item.
It begins...

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:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/exchanchor/htms/msexchsvr_cdo_top.asp

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.
Jay
 

Discuss This FAQ Item
Got a question? Another Suggestion? Want to post your solution? Discuss it below.
New Post
  • What do I need to send email int .net    [ Reply ]
  • Relaying    [ Reply ]
    • RE: Relaying    [ Reply ]
    • RE: Relaying    [ Reply ]
  • How to make command_bottom in VB.NET send Outlook Express email    [ Reply ]
  • Code or CDOSYS.DLL Load    [ Reply ]
    • RE: Code or CDOSYS.DLL Load    [ Reply ]
      • RE RE: Code or CDOSYS.DLL Load    [ Reply ]
        • RE: RE RE: Code or CDOSYS.DLL Load    [ Reply ]
  • Problems sending email    [ Reply ]
    • RE: Problems sending email    [ Reply ]
    • RE: Problems sending email    [ Reply ]
  • What if my code will reside on a webhost    [ Reply ]
  • What do i need about the smtpserver?    [ Reply ]
  • Problem in sending email    [ Reply ]
    • RE: Problem in sending email    [ Reply ]
    • RE: Problem in sending email    [ Reply ]
  • Use Outlook Express in VB.Net , What is its DLL    [ Reply ]
    • RE: Use Outlook Express in VB.Net , What is its DLL    [ Reply ]
  • What is my "From" address?    [ Reply ]
  • Sending many e-mails (but not beeing a Spammer)    [ Reply ]
  • mail ends up in queue    [ Reply ]
    • RE: mail ends up in queue    [ Reply ]
  • send mail in .net 2.0    [ Reply ]
  • How to use the exchange sever in System.Web.Mail    [ Reply ]
  • Sending Email Without IIS Installed    [ Reply ]
  • IIS SMTP Service in .NET 2.0    [ Reply ]
  • Sending Mail thru asp.net    [ Reply ]
    • RE: Sending Mail thru asp.net    [ Reply ]
  • Exception has been thrown by the target of an invocation.Mail asp.net 1.1    [ Reply ]
  • where do i recieve my mails?    [ Reply ]
  • failure mail error    [ Reply ]
    • RE: failure mail error    [ Reply ]
  • Sending mail in 2003 VB.Net Windows application    [ Reply ]
  • Unable to catch SMTP error in Dotnet application    [ Reply ]
  • Directory Path Not Specified Mail Error    [ Reply ]
  • Help me please    [ Reply ]