HTML Example

HTML emails allow you to send an email that looks like a web page including images and videos.

Example

Contact Form
To
From
Subject
Send Type


Step By Step For Mandrill

Step 1

First you need to follow the guide for integrating the DLL and setting up Easy Email at Setting Up.

In this example we will be storing the emails we are about to send in a string, this is for simplicity.

Next all that is required is the below code, placed inside the click handler of the send button.

protected void btnSend_Click(object sender, EventArgs e)
{
     //Create the recipient
    EasyEmailForMandrill.Recipient recipient =
    new EasyEmailForMandrill.Recipient(txtTo.Text);

    string htmlEMail = @"<h1>HTML email</h1><p>Content1</p><p>Content2</p>";
    string plainTextEmail = "HTML email Content1Content2";

    EasyEmailForMandrill.MandrillEmail email = 
    new EasyEmailForMandrill.MandrillEmail( recipient, 
                                            txtFrom.Text, 
                                            txtSubject.Text, 
                                            htmlEMail, 
                                            plainTextEmail);

    EasyEmail.EasyEmailResponse response = email.Send();

    lblOut.Text = "Easy Email response : " + response.Message;
}
            

Completed!

That's all you need to do to send an HTML email with Easy Email For Mandrill

Step By Step For SMTP

Step 1

First you need to follow the guide for integrating the DLL and setting up Easy Email at Setting Up.

In this example we will be storing the emails we are about to send in a string, this is for simplicity.

Next all that is required is the below code, placed inside the click handler of the send button.

protected void btnSend_Click(object sender, EventArgs e)
{
    string htmlEMail = @"<h1>HTML email</h1><p>Content1</p><p>Content2</p>";
    string plainTextEmail = "HTML email Content1Content2";

    EasyEmail.EmailMessage email = 
    new EasyEmail.EmailMessage(txtTo.Text, txtFrom.Text, 
    txtSubject.Text,htmlEMail,plainTextEmail);

    EasyEmail.EasyEmailResponse response = email.Send();

    lblOut.Text = "Easy Email response : " + response.Message;
}
            

Completed!

That's all you need to do to send an HTML email with Easy Email For Mandrill