all groups > dotnet clr > july 2003 >
You're in the

dotnet clr

group:

SMTPMail - problems with example code


SMTPMail - problems with example code Dennis Redfield
7/23/2003 11:01:39 AM
dotnet clr: I used the console app example code from MSDN for sending smtp mail. This
example code uses the line:
using System.Web.Mail;
When I attempt to compile I error out on the "using System.Web.Mail" line
with the message that the ".Mail" space does not exist under System.Web.
Looking at the docs for the CLR it should be there. When I use the object
browser in VS I see only a limited number of objects under System.Web. From
the documentation I should be seeing scores of objects ("Mail" included).
What am I doing wrong? I am working on a Win2k SP4 Professional machine
with the 1.1 framework installed.

thanks.


Re: SMTPMail - problems with example code Jon Skeet
7/23/2003 4:16:50 PM
[quoted text, click to view]

You need to add a reference to the System.Web assembly in your project.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
Re: SMTPMail - problems with example code Dennis Redfield
7/24/2003 10:32:27 AM
I have the line: using System.Web
in the code ALREADY. My question is why don't I see the Mail space?
If I add the addtional line (from the walkthrough code):
Using System.Web.Mail;
I get a compile error for that line.
This is a console app.

thanks.

dlr
[quoted text, click to view]

Re: SMTPMail - problems with example code Jon Skeet
7/24/2003 3:39:56 PM
[quoted text, click to view]

That's using a namespace, which is entirely different from referencing
an assembly. As I said before, you need to add a reference to the
System.Web assembly to your project.

In VS.NET you do this by right-clicking "References" under your
project, and finding System.Web.dll in there.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
Re: SMTPMail - problems with example code Dennis Redfield
7/24/2003 4:49:25 PM
I. C. thank you Jon.
[quoted text, click to view]

AddThis Social Bookmark Button