EPiServer Mail Configuration in an Enterprise Environment
EPiServer Mail 4.4
Document last saved:
Using separate broker account configurations in EPiServer Mail in an enterprise environment
From EPiServer Mail 4.4, the EPiServerMail.config file is located in the web root and is an extension of web.config. This means that it is not compatible with the old EPiServer Mail 4.3 configuration file format. During installation, a default configuration is deployed and populated with data collected from user input. If left that way, every site will share the same configuration.
On an enterprise solution, there might be times where some sites need to have their own specific configurations
- Add a new element under configuration/episerver.common/siteHosts in web.config. The name attribute is used to reference this site and the hostUrl attribute is used to determine in what context the configuration is used.
- Duplicate the episerver.mail/sites/site node in EPiServerMail.config and modify the hostName attribute of your copy to match the name attibute of your new siteHosts element and alter all other configuration that might differ (such as URLs, default values, SMTP server, etc).
- On your new site configuration element, make sure that the brokerName attribute on the broker element is empty and also preferrably remove the rsaKeyValue element if there is one.
- Now use the EPiServer Mail activation procedure, but you need to manually merge the site element from the received file to your existing EPiServerMail.config. This is due to that the received file will only contain information of the newly registered site.
If you want to keep accumulated data separate between sites using separate databases, proceed to the next section.
Using separate databases in EPiServer Mail in an enterprise environment
Using the instructions above, the broker accounts are separated from each other. To also have EPiServer Mail use separate databases for each site, do the following:
- Deploy a new EPiServer Mail database using EPiServer Deployment Center, "Installed Products/EPiServer Mail/Version 4.4.x.x/Install SQL Database"
- Add a new element for this under connectionStrings in connectionStrings.config and fill in the details used in the previous step.
- Change the reference on your new siteHosts element under configuration/episerver.common/siteHosts in web.config to reference your new connectionString in the connectionStringName element.
- Add a site element under configuration/episerver.common/sites in web.config with the hostName attribute set to match the name attribute of the siteHosts element you just created.