Installation tips

The Windows service need to be installed as a service in order to function. Fortunately this is quite easy because the exe 'MailAggregator.exe' supports command line installation e.g.
MailAggregator.exe -install

This must be done from an elevated process (aka Run as Administrator).

Config

In order to use aggregators they must be set up in the service's config file. A list of aggregators can be specified - multiples of the same type or different types or any mixture. Each entry is serviced separately by a host process while the service is running. The following is an example config file (MailAggregator.Properties.Settings section only}:
<setting name="AggrSources" serializeAs="Xml">
<value>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                        <string>&lt;source type="FlatFile" name="Test files" inputFilePath="C:\test" inputFileMask="*.txt" maxMsgSize="1048576" aggregatedSubject="Aggregated test message" aggregateBySubject="false" appendDoneFiles="True" defaultToAddress="someAddress@somedomain.com" appendDoneFileMaxSizeKB="10" /&gt;</string>
<string>&lt;source type="SqlServer" name="QuickMon Alerts" sqlServerName="someSqlserver" database="QuickMon" integratedSec="True" userName="" password="" aggregatedSubject="Sql Quickmon Aggregated Alert" aggregateBySubject="false" defaultToAddress="someAddress@somedomain.com,anotherAddress@somedomain.com" useSPs="True" selectMsgs="GetMailAggregatorMessages" markMessageDone="MarkMailAggregatorMessageAsDone" maxMsgSize="1048576" /&gt;</string>
                    </ArrayOfString>
                </value>
            </setting>
            <setting name="PollingFreqSec" serializeAs="String">
                <value>180</value>
            </setting>
            <setting name="NewVersion" serializeAs="String">
                <value>True</value>
            </setting>
            <setting name="SMTPHost" serializeAs="String">
                <value>smtpServer</value>
            </setting>
            <setting name="SMTPUseDefaultCredentials" serializeAs="String">
                <value>True</value>
            </setting>
            <setting name="SMTPDomain" serializeAs="String">
                <value />
            </setting>
            <setting name="SMTPUserName" serializeAs="String">
                <value />
            </setting>
            <setting name="SMTPPassword" serializeAs="String">
                <value />
            </setting>
            <setting name="FromAddress" serializeAs="String">
                <value>someAddress@someDomain.com</value>
            </setting>
            <setting name="IsBodyHtml" serializeAs="String">
                <value>True</value>
            </setting>
            <setting name="MessageBodyTemplate" serializeAs="String">
                <value>&lt;b&gt;Message %MsgNo%&lt;/b&gt;&lt;br/&gt;
&lt;b&gt;Subject: %Subject%&lt;/b&gt;&lt;br/&gt;
&lt;blockquote&gt;
&lt;pre&gt;%Body%&lt;/pre&gt;
&lt;/blockquote&gt;
</value>
            </setting>
            <setting name="MessageSeparatorTemplate" serializeAs="String">
                <value>&lt;hr/&gt;</value>
            </setting>

Last edited Feb 29, 2012 at 6:26 AM by RudolfHenning, version 1

Comments

No comments yet.