Because System.Web.Mail is one of the namespaces not pre-referenced when you create a new project.
In your project, right-click references->Add Reference and locate System.Web.dll.
Double-click or click and Select to add the reference to your project.
If you are not using Visual Studio, add /r:System.Web.dll when compiling your code.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.