help.axcms.netAxinom Logo
Save Save Chapter Send Feedback

MailCenter Template Project configuration

 

This chapter explains how to configure Newsletter Template solution and MailCenterServices We assume here that you have installed and set up the required virtual folders and set up databases.

We provide here only additional steps you need to do to make Newsletter Template to be able to send Newsletters.

AxCMS.Service and MailCenterService Configuration

Steps to install AxCMS.Service are provided in AxCMS.Service installation guide.

NewsletterQueueTask requires the URLs of the MailCenterWebService and of the MailCenterWebService from AxCMS.net. You can also configure how often the service should check for the newsletters to be sent and how many newsletters to process. If your Newsletter should be localized for the language of each subscriber, please set the name of the ResourceManager. This ResourceManager should be configured in AxCMS.net (in the AxCMSPublishService-application). Sub-sections NewsletterService and MailService follow standard AxCMS.net-format for the web-service-configuration.  Read more under Application Configuration.

To configure MailCenterService following steps are required:

  • Overview of MailCenter Configuration Files
  • Changes in MailCenterManagement configuration
  • Changes in MailCenterService configuration
  • Changes in MailCenterWebService configuration
  • Changes in Management System and Live System configs

Overview of MailCenter Configuration Files

Each AxCMS-Application needs its own configuration file. Comparing to PremiumSample configuration files you have 3 configuration files more located at the same place (C:\Projects\AxCMS_MailCenterSample\Resources_MailCenterSample\Configuration\SampleDEV\)

Following additional configs exist:

  • MailCenterManagement.config  -- for MailCenterManagement
  • MailCenterService.config          -- for MailCenterService
  • MailCenterWebService.config    -- for MailCenterWebService

Please, run Postbuild.bat (located at C:\Projects\AxCMS_MailCenterSample\Resources_MailCenterSample\Deploy\) each time you change configuration files. It copies configuration files to proper places. Start Services (AxCMS.Service and MailCenterService) only after you created your configuration. If you change the configuration later, the services must be restarted.

Here we provide some additional info on how these services should be configured

Changes in MailCenterManagement File Configuration

MailCenterManagement (MailCenterManagement.config) needs right Database connection string, to connect to Template Project Management database and a path to store the attachments of the letters.

<appSettings>
    <!-- ConnectionString to the Database  -->
    <add key="DBCONNSTRING" value="SERVER=(local);DATABASE=AxCMS_MailCenter;UID=MailCenter;PWD=AxinomCMS1" />
    <add key="UploadPath" value="c:\Projects\AxCMS_MailCenterSample\MailCenterManagement\attach" />
</appSettings>

Changes in MailCenterService File Configuration

MailCenterService adittionally to Database connection string and path to store the attachments needs an checking interval.

<appSettings>
   <!-- ConnectionString to the Database  -->
   <add key="DBCONNSTRING" value="SERVER=(local);DATABASE=AxCMS_MailCenter;UID=MailCenter;PWD=AxinomCMS1" />
   <!-- Upload path for attachments sending with newsletters -->
   <add key="UploadPath" value="C:\Projects\AxCMS_MailCenterSample\MailCenterService\attach" />
   <add key="CheckInterval" value="300"/>
</appSettings>

What is more, there are also configurations for Pop3 server, Queue Processor and log.

<QueueProcessor>
    <Interval>00:00:05</Interval>
    <NumberMessages>10</NumberMessages>
    <SmtpServer>smtp.company.com</SmtpServer>
    <SmtpPort>25</SmtpPort>
</QueueProcessor>

<Pop3ServerList>
    <Pop3Server name="1">
       <!-- The adress of Pop3-server -->
       <Address>pop.company.com</Address>
       <!-- The Port of your Pop3-Server -->
       <Port>110</Port>
       <!-- Account for checking for refused mails -->
       <Username>user@company.com</Username>
       <Password>password</Password>
       <!-- How many mails should be checked every time -->
       <MailCount>100</MailCount>
       <!-- Try to login if login fails to mail server -->
       <LogonRetrial>5</LogonRetrial>
    </Pop3Server>
</Pop3ServerList>

<log4net>
    <appender name="LogFileAppender" type="log4net.Appender.FileAppender" >
        <file value="MailCenter.log" />
        <appendToFile value="true" />
        <layout type="log4net.Layout.PatternLayout">
            <header value="[Header] "/>
            <footer value="[Footer] "/>
            <conversionPattern value="%date [%thread] %-5level %logger [%ndc] <%property{auth}> - %message%newline" />
        </layout>
    </appender>
    <root>
        <level value="ALL" />
        <appender-ref ref="LogFileAppender"  />
    </root>
</log4net>

You can configure several pop3 servers, just add each with different name.

Changes in MailCenterWebService Configuration File

Here you also need to provide database connection string and attachment upload path.

<appSettings>
    <!-- ConnectionString to the Database  -->
    <add key="DBCONNSTRING" value="SERVER=(local);DATABASE=AxCMS_MailCenter;UID=MailCenter;PWD=AxinomCMS1" />
    <add key="UploadPath" value="C:\Projects\AxCMS_MailCenterSample\MailCenterService\attach" />
</appSettings>

Changes in Management System and Live System configs

Management System Configuration

Management System provides GUI for tracing the newsletter messages in the MailCenter. NewsletterService- and MailService-configuration-sections are required to enable AxCMS.net to get the required information.

You need to add the following lines to your MS.Web.Config file:

<configSections>
    <section name="MailService" type="Axinom.AECMS.Gateway.GatewayConfiguration, AxCMS.BL"  />
</configSections>

<appSettings>
    <add key="CMSInstanceName" value="MailCenterSample"/>
</appSettings>

<MailService type="WebService">
    <Url>http://localhost/MailCenterWebService/MailCenterWebService.asmx</Url>
    <Timeout>5000</Timeout>
    <Username>CMSDev</Username>
    <Password>CMSDev</Password>
    <UseWSE>true</UseWSE>
</MailService>

Live System Configuration File

Also please update your Live-System configuration files (LS.Web.config) and copy there key with CMSInstance name. From AxCMS.net 8.3.0 there is a need of this value also in LS. This line should be in both configs:

<add key="CMSInstanceName" value="[PROJECT_NAME]" />

Troubleshooting

Here are possible problems and solutions about Newsletter Template Project. Please, consider that many components have to communicate properly to achieve the result. Make sure, you understand the big picture and check the configuration at every communication path.

Typical problems and resolutions:

You have published a newsletter, but it is not received by subscribers

1. Check, if there were subscribers at all. Newsletter has to be categorized into some categories, and there have to be some members (subscribers) in those categories. Category inheritance is not used for the Newsletter!

2. Check, if the newsletter is available at the Live System. You should be able to open it like any other page using its name in the Live System.

3. Check newsletter scheduling. You schedule newsletters to be sent immediately or at some particular time in the future. Check also the time settings of your server(s).

4. Check, if the AxCMS.Service is running and property configured. You can call the MailCenterWebService.asmx, configured in the Management System's web.config file, manually and ensure it replies properly. If there is nothing wrong with the service, restarting it could help sometimes.

5. Check, if your newsletter reached the MailCenter. Use the links Admin / MailCenter and Admin / MailCenterArchive for that. If the management pages do not work, check web.config in the Management System (see configuration chapter above). Mails to be sent are in MailQueue and mails, already sent, are moved to MailArchive.

6. Check, if the service tasks have not been deactivated. AxCMS.Service is responsible for preparing the individual newsletter emails and adding them to the MailCenter Queue. If sending out test newsletters does not work, check the Management System's database (probably named "AxCMS_MailCenterSample"). If final publishing of newsletters does not work, check the Live System's database (probably named "AxCMS_Live_MailCenterSample"). What you should check in the respective database:

Open table "AxServiceTask". Find the dataset where column "ClassName" contains value "Axinom.AECMS.page.NewsletterQueueTask". Check the column named "Active". This column's value might be set to "False". Change it to "True" and restart Windows service "AxCMS_Service".

You cannot access the MailCenter Queue and MailCenter Archive pages

Problem: when you try to navigate in to menu item "Admin" --> "MailCenter" or "Admin" --> "MailCenter Archive" you just see an overview page that displays two links (one to MailCenter queue and one to MailCenter archive). If you click one of those links nothing happens, you stay on the same page.

Solution: check your License file. In order to be able to use MailCenter you will need a special license file. In AxCMS.net versions prior to 9.0 there needs to be a special section which should look similar to this:

      <MailCenter Used="True">
        <MaxUser>0</MaxUser>
      </MailCenter>

 If this section is not there, please contact our support team (support@axinom.com).