Setting Up Easy Email For Mandrill

Setting up Easy Email For Mandrill is really easy, that's why we call it 'Easy Email'.

This page guides you through the two sections, integrating the DLL (easier than it sounds) and adding some Web.Config values.

If you haven't already got a Mandrill account you can get a FREE account at www.mandrill.com/.

Step 1 - The DLL

Adding the DLL

First add the EasyEmailForMandrill.dll file into your bin folder of your project.

Next right click on your project and select Add Reference.

Adding A Reference

In the screen that pops up select browse and then browse to the bin folder of your project. Once there select the EasyEmailForMandrill.dll file and click ok.

Adding A Reference

That's it!

Step 2 - Web.Config Values

Adding Easy Email configuration values

Easy Emails needs a couple of values just to know what to do.

  • EE.MandrillKey
    • The EE.MandrillKey sets the is your Mandrill Key. You can find this by logging into your Mandrill Account and then going to SMTP & API Credentials link. If you don't have any keys under API Keys click '+ New API Key' to add a new key.
  • EE.DefaultFrom
    • The EE.DefaultFrom sets the email address that will be displayed as the from address if you do not supply a from address whilst sending an email.
  • EE.ValidateEmailAddresses
    • The EE.ValidateEmailAddresses sets whether you would like Easy Email to automatically check email addresses prior to sending.

These values should be added in the <configuration> section of the Web.Config if you don't already have an AppSettings section. If you do you should add the keys to the <appSettings> section.

  <appSettings>
    <add key="EE.MandrillKey" value="KEY" />
    <add key="EE.DefaultFrom" value="test@EasyEmail.com" />
    <add key="EE.ValidateEmailAddresses" value="true" />
  </appSettings>
            

(Optional) SMTP values

If you wish you can use Easy Email For Mandrill to send SMTP emails through a mail server. The SMTP values are the details of your mail server, this is usually provided by your web hosting company. If not you can use a free service like Gmail.

These values should be added in the <configuration> section of the Web.Config.

<system.net>
    <mailSettings>
      <smtp>
        <network 
        host="mail.Server.co.uk" 
        userName="Username@Server.co.uk" 
        password="Password" />
      </smtp>
    </mailSettings>
  </system.net>
            

(Optional) Database Connection String

You only need to add a Database Connection String if you are planning to load templates from a database.

These values should be added in the <configuration> section of the Web.Config if you don't already have an connectionStrings section. If you do you should add the keys to the <connectionStrings> section.

<connectionStrings>
<add name="EasyEmail" 
connectionString=
"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\EasyEmailDatabase.mdf;
Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>