The type or namespace name 'Mail' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
How do I add that? (Fix)
Printable View
The type or namespace name 'Mail' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
How do I add that? (Fix)
It's System.Net.Mail not System.Web.Mail
Hurry up and mark this thread as resolved before jmcilhinney has a fit :D
He's gonna read it anyway, so you have no pointQuote:
Originally Posted by DNA7433
How do we know that the OP has even read the reply, plus it is incorrect to say that it is not System.Web.Mail because it is. System.Net.Mail is new in .NET 2.0, while System.Web.Mail exists in all versions of the Framework. The error here is not specifying the version being used, so we don't know. Either way you need to add a reference to the appropriate assembly to be able to use the types it contains. If you're using .NET 2.0 then it should be System.Net.Mail.dll, otherwise it has to be System.Web.Mail.dll. Once you've referenced the appropriate assembly your project knows it exists and can interrogate it to see what it contains. Then you can import namespaces from that assembly. Note that the two namespaces and the types they contain are similar but not the same, so make sure you read the documentation for the correct one. Please specify your version using the radio buttons provided when creating threads in the future. Otherwise you are more likely to get information that doesn't apply to you, and we may waste our time providing an elaborate solution that you can't use.
I told youQuote:
Originally Posted by DNA7433
I don't remember the old name for the namespace but you have a good point about the version toolQuote:
Originally Posted by jmcilhinney
please people specify the version in the future