Merging & Template featuresActiveUp.MailSystem provides many extended features to help create template based and data bound mails. You can even specify padding in your text messages!
Load Configuration from XML or Text File
The most effective method to send mail messages is to use ActiveUp.MailSystem’s template-based XML configuration. This will allow end users to configure and modify their e-mail account without requiring you to recompile the application. This example sends an e-mail message using the XML template and the form-submitted values for e-mail address and name.
Show XML file
<?xml version="1.0" encoding="utf-8"?> <Message> <From Name="Active Up Website" Email="support@activeup.com" /> <Subject>Thanks for downloading.</Subject> <SmtpServer>mail.activeup.com</SmtpServer> <SmtpServer>127.0.0.1</SmtpServer> <BodyText>Thanks for downloading our product ! Contact our support for assistance: support@activeup.com.</BodyText> <BodyHtml> <b>Thanks for downloading our product</b> !<br> Contact our <a href="mailto:support@activeup.com">support</a> for assistance.</BodyHtml> </Message>
Show C# code
Templater templater = new Templater("send_a_templated_email.xml"); templater.Message.To.Add("user1@example.com", "User1"); templater.Message.Send();
Show Message output
(Plain/Text Version)
Thanks for downloading our product! Contact our support team for assistance: support@activeup.com.
(HTML Version)
Thanks for downloading our product ! Contact our support for assistance.
Bind Bodies with Data Sources (DataTable, ArrayList, Custom collections, ...)
With ActiveUp.MailSystem, you are not limited to using only 'common' data sources like DataSet, DataTable or DataReader. You can bind to almost type of data source.
The example below demonstrates how to use the posted form collection as a data source. In the ancient days of CGI, Perl-based form processing scripts were very popular. This sample shows how easily this can be accomplished using the powerful features of ActiveUp.MailSystem.
Show XML template
<?xml version="1.0"?> <Message> <From NAME="Ordering System" Email="test@activeup.com" /> <To NAME="$FIRSTNAME$ $LASTNAME$" EMAIL="$EMAIL$" /> <Subject>Your order details [$ORDER_ID$]</Subject> <SmtpServer>smtp.domain.com</SmtpServer> <FieldFormat NAME="NAME" PADDINGDIR="Right" TOTALWIDTH="50" PADDINGCHAR=" " /> <FieldFormat NAME="QUANTITY" PADDINGDIR="Left" TOTALWIDTH="6" PADDINGCHAR=" " /> <BodyText>
Dear $FIRSTNAME$,
Thanks you for your order ! Please find the details below :
Order Number : $ORDER_ID$
Customer Id : $CUSTOMER_ID$
Product Name Quantity
-----------------------------------------------------
$PRODUCTS_TEXT$
-----------------------------------------------------
Please print and/or backup this message for future reference.
Thanks again for your order.
The NiceActiveShop team.
http://www.niceactiveshop.com
</ BodyText> <ListTemplate NAME="PRODUCTS_TEXT">
$PRODUCT$ $QUANTITY$
</ ListTemplate> <BodyHtml>
<p>Dear $FIRSTNAME$,</p>
<p> |