Click here to Skip to main content
15,878,748 members
Articles / Web Development / ASP.NET

Invoke .Net Assembly using SSIS:Email Framework

Rate me:
Please Sign up or sign in to vote.
4.43/5 (3 votes)
21 Oct 2008CPOL3 min read 49.1K   216   27  
This article demonstrate use of SSIS package that helps in invoking .Net Assembly having email component in it.
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Xml;
namespace EmailFramework
{
    public class NotificationManager
    {
        private static IDictionary<string, string> configSettings = new Dictionary<string, string>(); 
        static NotificationManager()
        {                 
            XmlDocument xmlDocument = new XmlDocument();
            xmlDocument.Load("D:/EmailFramework/EmailFramework/EmailFramework/app.config"); 
            XmlNodeList nodeList = xmlDocument.SelectNodes("configuration/appSettings/add"); 
            int index = 0;

            foreach (XmlNode node in nodeList)
            {
                string key = node.Attributes.GetNamedItem("key").Value;
                string value = node.Attributes.GetNamedItem("value").Value;
                configSettings.Add(key, value);
                index += 1;
            }
        }
        public static void NotifyDueForCreditPayment()
        {
            MailContent mailContent=new MailContent();
            try
            {
                mailContent.MailTo = "santosh.poojari@accenture.com";
                mailContent.MailFrom = "santosh.poojari@accenture.com";
                mailContent.Subject = "THIS TEST MAILER";
                //Body Content 
                Hashtable templatePlaceHolder = new Hashtable();
                templatePlaceHolder.Add("To", "santosh Poojari");
                templatePlaceHolder.Add("Credit_Card_Number",104562321373263 );
                templatePlaceHolder.Add("Due_Date", DateTime.Now);
                mailContent.IsBodyHTML = true;
                mailContent.MessagePriority = 1;
                mailContent.MessageText = string.Empty;
                EmailServices.SendRegisterNotification(mailContent, templatePlaceHolder, configSettings["ET_DueForCreditPayment"]);
            } 
            catch
            {
            }
        }
        public static void NotifyCreditCardExpiry()
        {

        }
        public static void NotifyApplicationForAddOnCard()
        {

        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Technical Lead
Australia Australia
Whatsup-->Exploring--> MVC/HTML5/Javascript & Virtualization.......!
www.santoshpoojari.blogspot.com

Comments and Discussions