473,508 Members | 4,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using System.Web.Mail; failed

Hi all,
I have installed VS.net 2003 fully.
When I create a C# project and write a line:using System.Web.Mail;
the IDE complain that the namespace Mail does'nt exist in System.Web.
Why it happens? Dis I miss something?
Thank you!

Nov 24 '05 #1
4 1833
You need to add reference to System.Web.dll.

Nov 24 '05 #2
You need to add a reference to the System.Web.dll. The System.Web.Mail
namespace is defined inside that.

Open Solution Explorer, right click the References node of the project
tree, and select Add reference. From the list select System.Web.dll,
press Select and OK. Now you have added a reference to this class
library, and can use it in your project.

-Lenard

Jason Zhang wrote:
Hi all,
I have installed VS.net 2003 fully.
When I create a C# project and write a line:using System.Web.Mail;
the IDE complain that the namespace Mail does'nt exist in System.Web.
Why it happens? Dis I miss something?
Thank you!


Nov 24 '05 #3
wow! Thank you so much!
You help a newbie's first step.:)
Thank Truong HOng Thi too.

"Lenard Gunda" <ar***********@freemail.hu>
??????:ux**************@TK2MSFTNGP09.phx.gbl...
You need to add a reference to the System.Web.dll. The System.Web.Mail
namespace is defined inside that.

Open Solution Explorer, right click the References node of the project
tree, and select Add reference. From the list select System.Web.dll, press
Select and OK. Now you have added a reference to this class library, and
can use it in your project.

-Lenard

Jason Zhang wrote:
Hi all,
I have installed VS.net 2003 fully.
When I create a C# project and write a line:using System.Web.Mail;
the IDE complain that the namespace Mail does'nt exist in System.Web.
Why it happens? Dis I miss something?
Thank you!


Nov 24 '05 #4
I don't know why it doesn't work with you.
It works fine with me.
maybe you need to use the fully qualified namespace within your code.
This is what your code should be:
//
System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage();
msg.From = "Sender Mail";
msg.To = "Reception Mail";
msg.Subject = "Message Subject";
masg.Body = "Message Body";
SmtpMail.SmtpServer = "Your MailServer";
SmtpMail.Send(msg);
//

this code should work fine..
let me know if not
Nov 24 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4293
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
5
2132
by: ElanKathir | last post by:
Hi ! I wrote one code for Send the E-mail, But that code have some problem , So please help me Here i paste my code and Error: Error: Server Error in '/Elan_Sample' Application. ...
0
1776
by: venner | last post by:
Hi group, I am currently developing two websites that will work together, but for several reasons are seperated into two projects. I am developing in ASP.NET 2.0 using VS2005. In my solution I...
0
2204
by: vincent | last post by:
Hi all, I'm getting this error when i running my applicaion with remote server from my local machine. An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in...
0
2757
by: Sister Ray | last post by:
I'm trying to create a simple form that sends an email using my company's exchange server. I'm using the System.Net.Mail Namespace of the .net framework 2.0. I've googled everywhere and i think my...
1
2886
by: CodeSeeker | last post by:
I have an application, which uses pop3 to read the messages from the mailbox, and it has been working fine for so many year. We recently have started changing this application to use java mail IMAP 4...
3
1414
by: mturner64 | last post by:
I'm working on a simple web app to send email. Below is my code: Imports System.Net.Mail Partial Class _Default Inherits System.Web.UI.Page Protected Sub SubmitButton_Click(ByVal...
13
1782
by: Beauregard T. Shagnasty | last post by:
My shared web host has made some sort of upgrade to .. something .. the support tech can't tell me what. It's a cPanel system, with all the regular stuff. The site is a club site. For years, I...
5
8279
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.