All project content is available for reading, but you need to be a member of the project for Subversion checkout of source code, or to create/modify any information.
Login if you are a member. Apply here to request membership (open to all).

Newsletter for EPiServer

This is a port of the old EPiSendMail (BV Network Newsletter) module from EPiCode, rewritten to support EPiServer CMS and Commerce 7.5 and newer.


  • Create newsletters as pages in EPiServer
  • Has recipient lists to hold your emails
  • Example templates with responsive email design using Zurb Ink
  • Will inline CSS to help make the email look correct in all (major) email clients
  • Configurable sender system (supports SMTP Server, pick up directory and Mailgun)
  • Send newsletters to contacts in Commerce using filtered contact lists

Additional Features when using Mailgun

  • Supports large amount of emails
  • Low cost per email (first 10.000 emails per month are free)
  • Supports tracking of delivery, open and clicks
  • Uses the Mailgun campaign feature to get a better overview of your newsletters


The installation is done through Visual Studio using the EPiServer Nuget Feed on http://nuget.episerver.com/

Main Newsletter Add-on:

Install-Package EPiCode.Newsletter

Commerce Integration:

Install-Package EPiCode.Newsletter.Commerce

MVC Examples for Alloy:

Install-Package EPiCode.Newsletter.Examples

Note! The examples package has requirements to code and configuration in the Alloy MVC sample. It will most likely fail to compile if you include them in a custom built site. You can look at the source here.

Example Newsletter Designs

The module will send a page in EPiServer CMS if it inherits the NewsletterBase base class. In addition to the Newsletter module itself, you also need a layout and design for the newsletter, that works across as many Email clients as possible. Download and test two example newsletters based on the Zurb Ink framework that has been made to work in the MVC version of the Alloy sample site.

See the developers guide for more information on how to implement your own newsletters.

If you want to look at the examples, but not install them, you can have a look at the source here.


  1. Select the EPiServer Nuget Feed in Visual Studio Nuget Package Manager Dialog or the Packet Manger Console
  2. Install the EPiCode.Newsletter or EPiCode.Newsletter.Examples (for Alloy) package
  3. Recompile your site (if you install the examples)


The module supports sending emails through different mail senders (also called a sender engine):

  1. Recommended: Mailgun (http://mailgun.com)
  2. Built-in smtp support (default)
  3. aspnetEmail component from AdvancedIntellect (license purchase required). Note! This sender is not actively supported, and will most likely be removed from the module.

Note! We recommend using the Mailgun sender, as it has the most features and offloads the sending process to the Mailgun servers. The first 10 000 emails from Mailgun per month is free. In order to send more emails you need to register a credit card.

The aspnetEmail sender engine is included for backwards compatibility, but will eventually be removed from the module.

Configuring SMTP

When installing the module, the default sender is the built-in SMTP client in .NET. In order to send emails, you need to configure the mailSettings in web.config:

Example using smtp server. There are more settings you can configure for password protected servers, ssl support etc.

    <smtp deliveryMethod="Network" from="noreply@my.domain.com">
      <network host="your.smtp.server"/>

You can also use a pick up directory if you have a SMTP server on your network that can access the pickup directory. The pickup directory delivery is preferable to network, as sending emails goes a lot faster, and you are less likely to get timeouts in the scheduled job.

    <smtp deliveryMethod="SpecifiedPickupDirectory" from="noreply@my.domain.com">
      <specifiedPickupDirectory pickupDirectoryLocation="c:\temp\email-pickup-directory" />

Note! The pickupDirectoryLocation can be on a network share.

Configuring Mailgun

Add the following keys to the <appSettings> section in web.config to use Mailgun:

<add key="Newsletter.SenderType" value="BVNetwork.EPiSendMail.Library.MailSenderMailgun, BVNetwork.EPiSendMail" />
<add key="Mailgun.ApiKey"    value="your-mailgun-api-key-here" />
<add key="Mailgun.Domain"    value="your-mailgun-domain-here" />
<add key="Mailgun.PublicKey" value="your-mailgun-public-key-here" />

The Api keys can be found on the Mailgun Account home page: https://mailgun.com/cp

You also need to configure your mail sending domain for your Mailgun account, which is well described on your Mailgun account page. For testing purposes, you can use the sandbox domain that is created when you register your Mailgun account.


If you get an error during startup like this: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ExtensionlessUrlHandler-Integrated-4.0' please check your web.config and remove any duplicate ExtensionlessUrlHandler-Integrated-4.0 handlers (under system.webServer)

Missing Assembly Redirects

In some cases, there are missing assembly redirects for some of the System.Net and System.Web assemblies. Make sure you have these in your web.config:

    <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="" newVersion="" />
    <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="" newVersion="" />
    <assemblyIdentity name="System.Web.Http.WebHost" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="" newVersion="" />
    <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="" newVersion="" />

Important! You might have never versions of these referenced in your project. Make sure you check the actual versions of the assemblies before you add the redirects.

Creating Newsletters

For a good example on how to create a newsletter design and content, see the Examples package above. The Newsletter module recognizes Newsletter pages in your site when your page type inherits from the NewsletterBase class, or implements the IRegisterNewsletterDetailsView.

You can have many different newsletter designs, just inherit the base class, and they will be recognized.

When the HTML for the newsletter is created, all styles will be inlined with the html elements to make it more probable that the design will look good in all major email clients.


Tickets for this component:

Move all labels and helptext to language files
Changing recipient list name
Create newsletter from newsletter admin page
Create wiki installation guide for Newsletter cms 7
Store Newsletter data in DDS
Move appSettings for Newsletter to dds

Ask a question

Requires login.

Report a bug

Requires login.

Add a feature request

Requires login.



  • EPiServer CMS 7.9 or newer
  • .NET 4.5


  • PreMailer.Net (1.2.6 or newer)
  • Microsoft.AspNet.WebApi (5.1.2 or newer)
  • RestSharp (104.4.0 or newer)


  • EPiServer Commerce 7.5 or newer for custom recipient lists

Contributed by

BV Network