Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

I am having an issue with system.web.mail namespace. I'm using VS.NET 2010 - VB.NET. I'm developing a project with SMTP support but when I try to import the system.web.mail references using solution explorer, it was not listed and when I tried to add it, it cannot be found. I have manually tried searching for the DLL and I cannot find it. Any Ideas? Or has anyone come across this issue before?

Sid
Posted
Updated 30-Jan-11 20:52pm
v2

Hi All,

Found the solution, system.web.mail is now obsolete namespace in .net framework 4. its now located under system.net.mail.

Cheers for all your help.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 31-Jan-11 1:34am    
Gosh, I did not check up, trusted Sandeep. My fault; and I voted "5".
I beg your pardon.
(However, this is in part your responsibility; everyone has to report in the Question, what version of the Framework you want to use.)
--SA
Sergey Alexandrovich Kryukov 31-Jan-11 1:42am    
I fixed my answer. Sorry for the inconvenience.
Please, in next questions indicate versions you want to use.
--SA
SIFNOk 31-Jan-11 16:54pm    
Sorry SA, My Mistake next time ill provide more detail.
Sorry for any mishaps! =)
It is found even in older versions of .NET Framework.
This is not something you add as a DLL: this is GAC. There are two steps: 1) add reference: System.Web; for v.4.0 — System.Net; 2) name space you want to use is System.Web.Mail (System.Net.Mail).

Don't mix them up: assemblies, DLLs (assembly is not always one DLL or EXE file a DLL is a module) and name spaces.

[EDIT]
After clarification by OP, added assembly for .NET Framework v.4.0.
Sorry for the inconvenience.

—SA
 
Share this answer
 
v4
Comments
SIFNOk 31-Jan-11 0:22am    
I cant not add the reference system.web via the Solution explorer. i can only locate the system.webservices.

Would this because i am using .net 4?
Sandeep Mewara 31-Jan-11 0:54am    
Sandeep, sorry, I edited your answer instead of mine...
But I must say you mislead me, OP was right, in v.4.0 this is System.Net.
--SA
Sergey Alexandrovich Kryukov 31-Jan-11 1:28am    
No, in .NET 4 this is in System.Net.
Sorry.
--SA
Espen Harlinn 31-Jan-11 15:11pm    
Well answered, 5+
Add a reference to System.Web and try again.

For an e.g. see here[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 31-Jan-11 1:30am    
Correct, useful supplement reference - my 5.
I provided a bit more detail - in vain -- see my answer and comment by OP.
Something must be wrong, how do you think?'
--SA
Abhinav S 31-Jan-11 1:32am    
Looks like the OP solved the problem by himself.
Sergey Alexandrovich Kryukov 31-Jan-11 1:39am    
I see. Please see my comment. We all made the same mistake, but OP should have indicated the version to use.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900