Installing the TemplateMailer server control
For more advanced installations, .NET developers can use the TemplateMailer Server Control to manage their email form submissions. First, unpack all files as described in the TemplateMailer WebDelivery method. Contained within the /ServerControl/ folder is the TemplateMailer.dll.
To use start a new Project or use an existing one within Web Matrix or Visual Studio. Next, add a Reference to the TemplateMailer.dll file. To best use the Server Control capabilities, add the TemplateMailer.SendTemplateEmail component to your ToolBox and drop & drag to your Web Form. Within the Properties Window under Data are the various variables and methods which are able to be defined. Each of these are covered in more detail within the CONFIGURATION:Design time section of this documentation.
To add a reference to the assembly TemplateMailer.dll.
If you are using Visual Studio.Net, use its Add Reference command.
Locate the file TemplateMailer.dll within the /bin/ folder. Note: You may put the TemplateMailer.dll into the Global Assembly Cache (GAC). If you do so, please do it before adding the reference. When it is in the GAC, do not copy it into the \bin folder. The Add Reference command recognizes an assembly that is already in the GAC and avoids copying it into the \bin folder. After setting up the reference, be sure the \bin folder does not contain the TemplateMailer.dll. In addition, go to Solution Explorer, select the Reference and choose Properties. The property CopyLocal should be false.
If you want this control in Visual Studio.Net's Toolbox, do this:
- Visual Studio.Net menus: Tools; Customize Toolbox
- Select the .Net Framework Components tab
- Browse and locate the TemplateMailer.dll
- The SendTemplateEmail control will be added.
- Simply Drag & Drop it on the the appropriate web form for configuration.