ASP.Net Question: How do I use ASPEmail in a Namespace?
Posted on 2003-11-20
Here's my problem. I hope I can describe it well.
I want to build single function/class which sends email that I can use in many different locations. I wish to make use of Persits ASPEmail which is free. The email component comes in a DLL and they have provided a "wrapper assembly".
According to the documentation:
<blockquote>AspEmail comes with an ASP.NET wrapper assembly, ASPEMAILLib.dll, which has to be placed in the \Bin subdirectory of your ASP.NET application. Alternatively, you can place this file in the Global Assembly Cache. </blockquote>
I am trying to build a .DLL module (my own namespace) using the VBC to compile it. In that module I declare a Namespace and in the namespace I declare a Class. In that Class I want to declare a public function which uses the ASPEmail component.
That way in my code I can write:
<%@ Import Namespace="MyNameSpace.Email" %>
(with MyNameSpace.dll in the /bin directory)
Then I can add in a call to: MyNameSpace.Email.SendEmail("email@example.com",...)
Can anyone point me in the right direction on how to go about doing this?
Is this the wrong way to structure such a beast?